I am getting Too many redirects error in my MVC application.
After i add UserFilter : ActionFilterAttribute how can i solve this problem ?
- public class UserFilter : ActionFilterAttribute
- {
- public override void OnActionExecuting(ActionExecutingContext context)
- {
- int? userid = context.HttpContext.Session.GetInt32("id");
- if (!userid.HasValue)
- {
- context.Result = new RedirectToRouteResult(
- new RouteValueDictionary
- {
- {"action","Index"},
- {"controller","Admin"}
- }
- );
- }
- }
- }