Quantcast
Channel: Why are Redirect Results not allowed in Child Actions in Asp.net MVC 2 - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by Jonathan for Why are Redirect Results not allowed in Child Actions in Asp.net MVC 2

$
0
0

In my unusual case, I had a custom AuthorizeAttribute attached to my controllers which was attempting to redirect on a child action, which is (as mentioned above) not allowed.

To resolve the issue, I removed authorisation checking redirection on all child actions:

Public Overrides Sub OnAuthorization(filterContext As AuthorizationContext)    //Child actions cannot redirect anyway, so no need to check permissions.    If filterContext.IsChildAction Then Exit Sub    .. parent authorisation checks ..

Viewing all articles
Browse latest Browse all 8

Trending Articles