Hi,
I wish to lock out access to html page (eg. /manual/manual_A/index.html) if a certain condition is not met (eg. HttpContext.Current.Request.Form["key"].toString().Equals("a") ), I wish redirect to specific view (eg. /errorPage/) else continue (eg. /index). In register Route I add:
routes.MapRoute(
"ErrorPage",
"errorPage/",
new { controller = "Home", action = "ErrorPage" }
);
routes.MapRoute(
"Path",
"{*_request}",
new { controller = "Home", action = "Index" }
);
for read all request. In controller Home
[CustomAuthorize]
public ActionResult Index()
{
}
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
if(!condition)
filterContext.Result = RedirectToAction("PageError");
}
OnActionExecuting executes on every request, however, RedirectToAction does not happen. Any hints as to what I'm doing wrong?