Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 136435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:56:53+00:00 2026-05-11T06:56:53+00:00

How can I do this: I have on page named Schedule and it can

  • 0

How can I do this: I have on page named ‘Schedule’ and it can be accessed through 2 differente ways:

URL 1- www.bla.com/Admin/Schedule URL 2- www.bla.com/Schedule 

‘URL 1’ will be accessed by users with Admin previlegies and this View will show some Admin stuff, and users must be LoggedOn.

In the otherhand, ‘URL 2’ will be accessed by users NOT LoggedOn and it will NOT show the admin stuff.

But, they are the same page, just with some differences depending on user’s access.

I already have AdminController and I intend to put this ‘Schedule’ View as part of this controller. As result, I know if I type ‘URL 1’ it will work. But, if I type ‘URL 2’? Will I have to create a ‘ScheduleController’ just to handle this?

I wonder if there is a way to resolve this by Global.asax, configuring the routing… I don’t know…

Thanks!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:56:53+00:00Added an answer on May 11, 2026 at 6:56 am

    You can map the /Schedule route to the /Admin/Schedule action from the Global.asax.cs like this:

            routes.MapRoute(             'Schedule',             'schedule',             new { controller = 'Admin', action = 'Schedule' }         ); 

    This will solve your immediate problem of wanting two separate routes resulting in the same action/view.

    However, this will not solve your scenario properly. The main issue is that the identity of the logged on user is orthogonal to the route the request takes. In other words, you can’t force the admin user to always hit the /Admin/Schedule route, they could just as well hit the /Schedule route and still would expect the same end result. Not only that, but doing it this way will prevent you from using the [Authorize] attribute on the Admin controller or the action to force the user to login and will have to implement custom logic checking which route the action was hit through and decide whether you want to force login or let the user through.

    Thus, you have to make a decision:

    • you share the controller, action and the view and determine whether to show the additional information in the view based on the identity and the role membership of the logged on user (if any). You will have to change the name of the controller then, as /Admin will not reflect the new role this class has;
    • you share only the view and have two separate controllers and actions – Admin.Schedule and User.Schedule. You will have to put the view in the /views/shared folder and return the same view fromboth actions, potentially passing different model. You’ll end up with two routes – /Admin/Schedule and /User/Schedule;
    • you have two separate controllers, actions and views.

    In all three cases, you can still have the rule above pointing to the appropriate controller, if you want to have also the shortest /Schedule route.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this page here: http://www.eminentmedia.com/development/powercity/ As you can see when you mouse
I have a Page with many Comments. Many users can access this page and
I have this exact issue ASP.net can’t update page from event handler and it's
how can i redirect to a page from sharepoint? i have this within the
Can someone help me out with this one. I have a page, in which
I have a cancel button on a page. But this page can be opened
Multiple sites have buttons where you can tweet, digg, etc. On this page you'll
How can I prevent caching on exception? I have this action: caches_page :index ...
IF i have the following: MyString.ValueType = typeof(System.Decimal); how can i make this have
I hope I can explain this right I have two input fields that require

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.