On OnActionExecuting for a controller, I'm trying to do a permanent redirect. The code looks like this:
protected override void OnActionExecuting(ActionExecutingContext filterContext) {
var resolvedUrl = "http://www.cnn.com";
filterContext.Result = new RedirectResult(resolvedUrl);
filterContext.Result.ExecuteResult(filterContext);
return;
}
It's not immediately redirecting because this method is in a base class, and after the return statement, the inherited class's OnActionExecuting method is called.
Question: how do I do the redirect and stop there, and not do anything in the inherited class. Thanks.
Note: in the child class (one that's inheriting from base), I have base.OnActionExecuting(filterContext); in its OnActionExecuting.