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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:15:59+00:00 2026-06-02T19:15:59+00:00

ASP MVC scaffolding creates Index, Create, Update, Delete views, but how practical is that

  • 0

ASP MVC scaffolding creates Index, Create, Update, Delete views, but how practical is that in reality. There seems to be a lot of duplication of UI code with the Create, Update and Delete views. Would it not be more practical to have one view for listing and another for Add/Edit and use some switch to format the view appropriately for Adding or Editing, and allowing deletion off the listing and edit views without redirecting to another view, instead simply popping up some sort of a “Please confirm the delete…” message?

If anyone has done something like this and is willing to share some code snippets or T4 scaffolding templates for generic cases it would be greatly appreciated.

  • 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-06-02T19:16:00+00:00Added an answer on June 2, 2026 at 7:16 pm

    Actually the NuGet package MvcScaffolding does exactly that, using a CreateOrEdit partial view. (See here.) The add/edit views are then created by referencing the partial view (targeting a different controller action respectively):

    <fieldset>
        @Html.Partial("_CreateOrEdit", Model)
        <input type="submit" value="Create" />
    </fieldset>
    

    Another alternative would be to use the default MVC scaffold (as defined in the model using data annotations attributes).

    <fieldset>
        @Html.EditorForModel()
        <input type="submit" value="Create" />
    </fieldset>
    

    As far as delete, you can always add a second mini-form at the bottom of any view (or in a list):

    @{ using (Html.BeginForm("Delete", "MyController", FormMethod.Post))
        {
            @Html.HiddenFor(model => model.id)
            <input type='submit' value='Delete' />
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By default in ASP.NET MVC, when the system generate views (scaffolding) we have the
I have an ASP MVC web app and on one of the pages there
I'm generating the bulk of my ASP.NET MVC scaffolding code. All generated files are
I have a asp mvc 2 web application that with forms authentication. It is
I have small Asp MVC 3 project where I need to create link to
When I used asp.net mvc 3 scaffolding to make a list. I got a
Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work
There are many ASP.MVC blog post bits and pieces scattered over different web sites,
Is there anything that would aid us in designing/scaffolding View models from SQL Server
What options do we have for scaffolding controllers in ASP.NET MVC (v2 and v3

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.