Hi,
I'm trying to execute a Redirect from a method attribute. It seems to work:
public class MyAttribute: ActionFilterAttribute {
[..]
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
[..]
filterContext.HttpContext.Response.Redirect(urlToRedirectTo, true);
[..]
The only problem is that the redirect is executed after the end of the method it's attached to, while i'd like the redirect to prevent the execution of the method.
Any help? Thanks