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"}
- }
- );
- }
- }
- }
Sachin SinghPosted Jun 2, 2021, 12:09 PM
Uygar KılıçPosted Jun 4, 2021, 9:26 AM
Sachin SinghPosted Jun 3, 2021, 7:51 AM
Uygar KılıçPosted Jun 3, 2021, 7:29 AM
Sachin SinghPosted Jun 2, 2021, 1:39 PM
Uygar KılıçPosted Jun 2, 2021, 1:33 PM
Sachin SinghPosted Jun 2, 2021, 1:06 PM
Uygar KılıçPosted Jun 2, 2021, 12:59 PM
Sachin SinghPosted Jun 2, 2021, 12:17 PM
Uygar KılıçPosted Jun 2, 2021, 12:14 PM