Different Types Of Views

Different types of views

Hello everybody,

today I want to write few words about different kinds of Views in .Net core.

So, if you decide somehow to create new view you can see something like this:

and now question. What is the difference between MVC View Page, MVC View Layout Page, MVC View Start Page and MVC View Imports page?

So, if to draw the lines then following can be said. 

MVC View Page is fitting for displaying different models.

MVC View Layout Page is inteded as View that has @RenderBody() statement. RenderBody will be placeholder where MVC View Page will be rendered. 

MVC View Start Page is used as mediator between MVC View Page and MVC View Layout page.

The last puzzling view is MVC View Imports file. 

@using DPlatform
@using DPlatform.Models
@using DPlatform.Models.AccountViewModels
@using DPlatform.Models.ManageViewModels
@using Microsoft.AspNetCore.Identity
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

As you can see it is just description of imports of models that will be used in your views. Or convenient way to avoid pointing at every view your usings.

No Comments

Add a Comment
Comments are closed