RedirectToAction is protected, and we can use it only inside actions. But if I want to Redirect in Filter?
public class IsGuestAttribute: ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (!Ctx.User.IsGuest) filterContext.Result = (filterContext.Controller as Controller).RedirectToAction("Index", "Home");
}
}
Something that could make it worked?