ASP.NET MVC 3 Scaffolding Quick Start
page 3 of 3
by Steven Smith
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30750/ 57

Summary

The latest tools for ASP.NET MVC 3 make it extremely easy to get started with a data driven application starting with code.  You can quickly create a model in C#, provide a few simple annotations to specify key values, display names, and validation constraints, and then simple but functional data management screens are a few clicks away.  The result, while easy to produce, is generally good code (though it would be a better design not to call the data context directly from the controller, but rather to inject it via an IRepository interface) that can easily be tailored to suit production requirements.

Download the sample code for this article here.

 


View Entire Article

User Comments

Title: Head   
Name: Rashmi
Date: 2011-05-16 12:02:42 AM
Comment:
this is a great article. Will help me in my project.
Title: insert problem   
Name: Eile
Date: 2011-05-13 7:39:07 PM
Comment:
if i don't want to insert the publication Date what should i do? Or set the publication Date to Datatime.now()

it doesn't looks it will work if i delete publication date code in Create.cshtml page. There should be an opinion on what you want field that you want insert and what you dont
Title: One model per controller?   
Name: Sam
Date: 2011-05-12 8:57:00 PM
Comment:
Who uses only one model per controller? I tried it and it doesn't work in practice. I have a model for every unique form which typically results in an add model, edit model, view model, listing model and search model (for the listing search form). This tooling would be useful if it prompted for the model class to use for each of operation the controller 'scaffolds' for you.
Title: Thanks   
Name: Me
Date: 2011-05-12 8:31:09 AM
Comment:
Short and sweet. Nice.
Title: Very good article   
Name: Kaka
Date: 2011-05-12 5:07:26 AM
Comment:
nice






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-09-15 4:32:48 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search