Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Index()
- {
- if (HttpContext.User.IsInRole("admin"))
- return RedirectToRoute("Admin");
- else
- return View();
- }
- routes.MapRoute("Admin", "admin",
- new { area = "admin", controller = "Users", action = "Index" }
- );
- public override void RegisterArea(AreaRegistrationContext context)
- {
- context.MapRoute(
- "admin_default",
- "admin/{controller}/{action}/{id}",
- new { action = "Index", id = UrlParameter.Optional }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement