Introduction: in this article I will explain what is Scaffolding in Asp.net MVC.
In the last article I have explained How to integrate Captcha in asp.net, How to create Contact Us page in Asp.net and What is Asp.net MVC? Its advantages and disadvantges.
Scaffolding is used by many software technologies. It’s a code generate framework in MVC application. Scaffolding provides as quick way to generate code for CRUD (Create, Read, update and Delete) in MVC application. Scaffolding is time saving to write code for application.
To perform scaffolding action in MVC application Right click on Controllers folder >> Add >> Controller. Pop up window will open and choose the second option for template for CRUD action. In Model class choose the class for which you want to perform action, Data context class choose the DbContext model for which action will be performed and Views option (none, Aspx and Razor).
I have a class Student_Detail and DBContext class TESTEntities in Models for which I want to add Controller. Right click on Controllers folder >> Add >> Controller and pop up window open as shown in below attached snapshot:
If you do not like the scaffolding template with CRUD than you can select empty or empty read/write actions to write customize code.
If you go with CRUD template see the below attached snapshot:
Is it helpful?
What do you think about this article?
If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.