我以前的问题已解决asp.net mvc validate [HttpPost] ActionResult()
右!现在我需要重定向到" controller / action / parameter"来自ActionFilterAttribute Helper Class中的OnActionExecuting()方法。在行
public class HelperSeguridad : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
.
.
.
if (permission != “”)
{
redirect "HERE"
}
}
}
控制器代码:
public class PaisController : Controller
{
.
.
public ActionResult Error(Exception ex)
{
ViewBag.error = ex;
return View();
}
}
THKS!
答案 0 :(得分:0)
试试这个:
filterContext.Result = new RedirectToRouteResult(
new RouteValueDictionary {
{ "action", "login" },
{ "controller", "persons" },
{ "someQuerystring", "someValue" }
}
);