コード例 #1
0
 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();
     }
 }
コード例 #2
0
 private IController CreateRedirectionController(RequestContext requestContext, string actionNameToRedirectTo, string controllerNameToRedirectTo, RouteValueDictionary routeValues)
 {
     Redirection.OpenRedirection(requestContext.HttpContext, actionNameToRedirectTo, controllerNameToRedirectTo, routeValues);
     SetAction(requestContext, "ByRedirectionManager");
     return(new RedirController());
 }