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 6825649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:03:29+00:00 2026-05-26T22:03:29+00:00

I am just starting with MVC, moving from web forms. Lets take for example:

  • 0

I am just starting with MVC, moving from web forms.

Lets take for example:

I have a page that shows a list of contacts with properties such as first name, last name, company, phone, email address, etc….

On that page, a user role determines if they can see particular columns. So an admin could see the phone and name while a basic user could only see company, address and a few others.

Would you toss that logic into a view or have the controller do the logic and use another view?

Seems to me that making the controller would be the best but the views could get repititve.

Thanks for the help, trying to wrap my ahead around it.

(Any good book recomendation are welcome, trying to read a few.)

  • 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-26T22:03:29+00:00Added an answer on May 26, 2026 at 10:03 pm

    I’d have two FormViewModels.

    The first containing columns the Admin can see and the second with columns a basic user can see.

    I’d implement an interface and use that as the model for the view.

    Then in the controller, I’d return one or the other depending.

    You might consider using a partial view for each type of user and then simply;

    <% if (user.isAdmin){ %>
      <% Html.RenderPartial("Admin", model); %>
    <%} else {%>
      <% Html.RenderPartial("BasicUser", model); %>
    <%}%>
    

    The other way to do this is to maybe have the view do this and you can create a helper class to check to see if the user is an admin

    <% if (user.isAdmin){ %>
      //Column for admin
    <%}%>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just starting my first MVC Web Application and have noticed that I
Just starting out in ASP.NET MVC - I have a page in ASP.NET MVC3
I am just starting porting an application to ASP.net MVC and I have an
Just starting out in asp.net. Have just created a login.aspx page in my site
I'm just starting out in ASP.NET MVC (and web applications in general, as I've
I'm just starting to get into ASP.NET MVC, and saw today that the Beta
I'm just starting with the Microsoft stack doing a web site in ASP.Net MVC
I’m just starting to explore asp mvc and jquery. I have a simple form
I'm new to ASP.NET and have just starting to learn ASP.NET MVC 3. I've
Just starting out with ASP.NET MVC and have come across a stumbling block already.

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.