Problem with ASP.NET MVC routing?

You could accomplish this in the controller as ajma said by just having an if condition and a switch statement in a method that checks if the user exist like so: if(UserID! =null) { switch(UserPreference) { case 1: action = "Schedules"; top = TypeOfPage. Admin; view = "Schedules"; break; default: action = "Schedules"; top = TypeOfPage.

Nonuser; view = "Schedules"; break; } }.

You can do it in your controller instead of the routing. RedirectToAction or RedirectToRoute can help you.

I have these: App > Controllers > Admin > AdminController and AgendaController To have this: "/Admin/Agenda/Index" working I had to do this: routes. MapRoute( "AdminAgenda", "Admin/{controller}/{action}/{id}", new { controller = "Admin", action = "Index", id = "" }, new { controller = "Agenda" } ); This: "/Agenda" also works but I don't know yet... but, that's not my problem right now. So, for my "Schedules" page, I want to create a new Controller named SchedulesController under App > Controllers > Admin So, what I need is when a person types "/Admin/Schedules", it will require to be loggedOn, because.

But, when a person only types "/Schedules", it will be able to see the page, but with some features out because it is not an admin user. So, the 2 routes will lead to the same page... how can I do that? Thanks!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions