s.k.Soni
s.k.Soni

Reputation: 1310

What is layout indicates in view page of nopcommerce 3.90?

I want to know that what is layout in view page of nopcommerce which given the path of other view page. But if I remove that layout then also there is no change in nopcommerce.

Like in index.cshtml there is Layout = "~/Views/Shared/_ColumnsOne.cshtml";.

Now, my question is why this other cshtml path has given, and if I remove this line then why is there no change in nopcommerce?

Upvotes: 0

Views: 141

Answers (2)

Kalpesh Boghara
Kalpesh Boghara

Reputation: 461

Into nopcommerce layout means a master page.

That can be used into all pages as master layout.

If you remove that line than nopcommerce affect design layout.

If your design is not change than this page called as partial page, means call with in any other view page.

Upvotes: 0

animalito maquina
animalito maquina

Reputation: 2414

The Layout property allows you to configure a "parent" view, the system renders the views from parent, in your case _Root.Head.cshtml -> _Root.cshtml -> _ColumnsOne.cshtml -> Index.cshtml, inside every layout cshtml you can find a @RenderBody() call where the child view is rendered.

When you remove the layout line inside Index.cshtml the system looks for the a default value and that value is configured inside the _ViewStart.cshtml, and this layout has configured the _ColumnsOne.cshtml, thats the reason that you cant see any changes.

The content of the _ViewStart.cshtml

@{
    Layout = "~/Views/Shared/_ColumnsOne.cshtml";
}

Upvotes: 2

Related Questions