I have an Action Filter that validates if something exists and executes a redirect
to redirect to a page x.
public class CustomFilterAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
string miString = algo; // puede venir null o no
if (string.IsNullOrEmpty(miString)
filterContext.Result = new RedirectResult("www.google.cl");
return;
base.OnActionExecuting(filterContext);
}
}
But the redirect does not work, I was debugging and if it enters if
but it just does not do what it should do. Does anyone know how to achieve this? or else I'm failing.