namespace WebApplicationRazor.Data
{
public class custom_filter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
base.OnActionExecuting(context);
}
}
public class CustomFilterAttribute : ResultFilterAttribute
{
public override void OnResultExecuting(ResultExecutingContext context)
{
//if (context.HttpContext.Session["user"] == null || context.HttpContext.Session["user"] == "")
context.HttpContext.Response.Redirect("/");
base.OnResultExecuting(context);
}
public override Task OnResultExecutionAsync(ResultExecutingContext context
, ResultExecutionDelegate next)
{
context.HttpContext.Response.Redirect("/");
return base.OnResultExecutionAsync(context, next);
}
}
}
No comments:
Post a Comment