Add binding to RedirectToAction result?

I am trying to create an extension method similar to the MVCContrib RedirectToAction method by creating a method that will take the #anchor argument and add this to Url. I am familiar with this question , but he did not score much. It is also possible to add values ​​to the query string, but this will not work for binding.

public static RedirectToRouteResult RedirectToAction<T>(this Controller controller, Expression<Action<T>> action, string anchor) where T : Controller
{
   var result = new RedirectToRouteResult<T>(action);

   // how can I add the #anchor to the result url?

   return result;
}
+3
source share

Source: https://habr.com/ru/post/1765890/


All Articles