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

  • SEARCH
  • Home
  • 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 697029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:07:33+00:00 2026-05-14T03:07:33+00:00

Is it considered bad practice to have multiple views for same URL in MVC,

  • 0

Is it considered bad practice to have multiple views for same URL in MVC, based on different user roles? For example:
http://www.domain.com/ViewProductID/123 will show a “normal” product page for a regular user and it will show an “enhanced” (product stats, ability to edit title etc..) version to someone logged in as admin.

If it’s bad practice, why? If it’s ok, what’s the best way to implement it? 2 separate templates or 1 template scattered with if..else?

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. Editorial Team
    Editorial Team
    2026-05-14T03:07:33+00:00Added an answer on May 14, 2026 at 3:07 am

    I think it’s fine to modify the view based on context; it happens all the time. Whether you do the if.. else or the multiple aspx files is really dependant on how much is different. A couple alternate options:

    1) use Html.RenderAction to call against an AdminController actions to embed the stuff, the AdminController can return empty results if the user isn’t an admin

    or, better:

    2) use a different Master page based on the user’s role / status. This way, you can pull the logic for setting the master into an actionfilter ot he like, and do it one time but apply it wherever it makes sense. Just make sure that the alternate Master pages are compatible w/ the views in terms of the contentplaceholderId’s.

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

Sidebar

Related Questions

Is it considered bad practice to have multiple try's in one method and structure
I know that having diamond inheritance is considered bad practice. However, I have 2
I think it's considered a bad practice to have controls appearing and disappearing and
Is it considered bad practice to expose events in .net interfaces? I have found
Is type checking considered bad practice even if you are checking against an interface?
Earlier I asked why this is considered bad: class Example { public: Example(void); ~Example(void);
For a user object in my asp.net mvc project, I have written a custom
What is considered as best practice when it comes to assemblies and releases? I
Are modal windows/dialogs considered a good practice for websites? One of the things that
It seems to me that explicitly specifying serialVersionUID for new classes is bad. Consider

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.