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

The Archive Base Latest Questions

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

Most MVC tutorials I’ve been reading seem to create 4 View objects for each

  • 0

Most MVC tutorials I’ve been reading seem to create 4 View objects for each Model. For example, if my Model is “Foo”, there seem to be 4 .cshtml files: Foo/Create, Foo/Delete, Foo/Details, and Foo/Edit. Using the VisualStudio “scaffolding” helper does this as well.

Is this really considered MVC best-practice? It just feels wrong to have 4 classes that are 80-90% identical to each other. When I add a new field to Foo, I need to edit all 4 .cshtml files. This sort of dual-maintenance (quad-maintenance?) just makes my OO skin crawl.

Please tell me: is there an expected/accepted best-practice which handles this differently? Or, if this really IS accepted best-practice, tell me why the quad-maintance shouldn’t make me squirm.

I’m a reasonably skilled veteran of ASP.NET / c# / OO Design, but pretty new to MVC; so apologies if this is a noob question. Thanks in advance for your help!

Edit: thanks for all the replies! I marked the most thorough one as the answer, but upvoted all that were helpful.

  • 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-26T06:11:43+00:00Added an answer on May 26, 2026 at 6:11 am

    You’ll probably need between two and four different views:

    • List (for viewing many things)
    • View (for viewing a single thing. Might not be necessary, if it’s OK to use Edit as View, or if List has room to show all properties)
    • Create
    • Edit (can be the same as create, if you code cleverly)

    Thus, if your model doesn’t have too many properties to show them all in a table, and if you’re OK with not having a static, non-editable view for just examining, you can get well away with just List and Edit, and scrap the other two.

    However, this doesn’t solve your problem of double (or triple) maintenance if you update your model. There’s other magic for that 😉

    In ASP.NET MVC 3, there are extensions on HtmlHelper that let you do Html.DisplayForModel() and Html.EditorForModel(). These use predefined templates to nest themselves into your object and draw up display/edit fields for all public properites. If you pass DisplayForModel an IEnumerable<Foo>, it will create a table with column headers that are the property names of Foo (using the DisplayName attribute information if you supplied it) and where each row represent one Foo instance. If you give EditorForModel a Foo, it will create a <label> and an <input> for each public property on Foo.

    All of the templates used by these powerful extension methods can be replaced by you, if you’re not happy with the defaults. This can be done either on the level of Foo, in which case you’d be back in your double-maintenance scenario, or on lower levels (such as string or DateTime) to affect all editor/display fields generated with the templates.

    For more information on exactly how this works, google “ASP.NET MVC 3 editor templates” and read a couple of tutorials. They’ll explain the details much better than I could.

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

Sidebar

Related Questions

This time I have a more philosopical question. Most MVC tutorials/books seem to suggest
I've been reading this paper: Enforcing Strict Model-View Separation in Template Engines (PDF). It
Are there any tutorials/examples on how to create an asp.net mvc app without the
Most of the MVC samples I have seen pass an instance of the view
In most of the tutorials for PHP MVC design structures, a router class is
I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now,
I have been reading a number of tutorials on implementing Structure Map IoC/di into
I have been trying to follow the few tutorials on how to create a
I am reading lots of tutorials on MVC, so my question, can a perfect
Most of the ASP.NET MVC paging solutions I have found by googling look like

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.