Redirecting to specified controller and action in asp.net mvc action filter

后端 未结 3 588
后悔当初
后悔当初 2020-11-29 21:41

I have written an action filter which detects a new session and attempts to redirect the user to a page informing them that this has happened. The only problem is I can not

3条回答
  •  孤城傲影
    2020-11-29 21:59

    Call RedirectToAction using this overload:

    protected internal RedirectToRouteResult RedirectToAction(
        string actionName,
        RouteValueDictionary routeValues
    )
    

    In Action Filters, the story is a little different. For a good example, see here:

    http://www.dotnetspider.com/resources/29440-ASP-NET-MVC-Action-filters.aspx

提交回复
热议问题