0

I have a page that I want it to have 2 different routes: "/Admin/Schedules" AND "/Schedules"

"/Admin/Schedules" if for admin users and the page will render some admin features and it needs to log in... on the other hand, "/Schedules" is for non-logged users and it will render non-admin features...

But, the page is the same and I specifically need these two routes...

Does anyone know how to do this?

Thanks!!!

4
  • Yes, it is named Admin...And I also have a SchedulesController... Commented Jan 29, 2009 at 17:51
  • And theses both Controlles are under a path "Admin" Commented Jan 29, 2009 at 17:52
  • Do you use your method in the controller to manipulate the view based on the non-user or user rights? Commented Jan 29, 2009 at 17:53
  • No... how can I manipulate the View based on the user?? Commented Jan 29, 2009 at 18:13

2 Answers 2

1

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;
       }
 }
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.