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