public override void OnActionExecuting(ActionExecutingContext filterContext) { if (!filterContext.RouteData.Values.ContainsKey(RouteValueName)) { Redirection redirection = Redirection.OpenRedirection(filterContext.HttpContext, "ValueMissing", "Error", new RouteValueDictionary() { { "Valuename", RouteValueName } }); filterContext.Result = redirection.GetResult(); } }
private IController CreateRedirectionController(RequestContext requestContext, string actionNameToRedirectTo, string controllerNameToRedirectTo, RouteValueDictionary routeValues) { Redirection.OpenRedirection(requestContext.HttpContext, actionNameToRedirectTo, controllerNameToRedirectTo, routeValues); SetAction(requestContext, "ByRedirectionManager"); return(new RedirController()); }