1.

What Are The Differences Between Partial View And Display Template And Edit Templates In Mvc?

Answer»
  • DISPLAY Templates – These are model centric. Meaning it depends on the properties of the view model used. It uses convention that will only display LIKE divs or labels.
  • Edit Templates – These are also model centric but will have editable controls like Textboxes.
  • Partial View – These are view centric. These will differ from templates by the WAY they render the properties (Id’s) Eg : CategoryViewModel has Product class property then it will be rendered as Model.Product.ProductName but in case of templates if we CategoryViewModel has List<Product> then @Html.DisplayFor(m => m.Products) works and it renders the template for each item of this list.

 

 



Discussion

No Comment Found