What different types of Scaffold templates are there in ASP.NET MVC?

 Posted by Sheonarayan on 10/24/2013 | Category: ASP.NET MVC Interview questions | Views: 5905 | Points: 40
Answer:

There are 6 different types of Scaffold templates in ASP.NET MVC that is used to create a view automatically based on the Model selected.

Empty:
It creates an empty view and only model type is specified in the View page using @model

Create:
It creates a view with a form that helps to create a new record for the model. It automatically generates a label and input field for each property in the Model.

Delete :
It creates a view with the list of records from the Model collection along with Delete link to delete records.

Details:
It creates a view that displays a lable and the value of each property of the Model.

Edit
It creates a view with a form for editing existing model data. It also generates a form with label and field for each property of the Model.

List:
It creates a view with html table that lists the model from the Model collection. It generates html table column for each property of the model. In general, it accepts IEnumerable<ModelType> and iterate through each item of the Enumerable collection. It automatically renders edit, delete links for each record of the Model collection in a column and Create link on the page that target to Create action.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response