sksoni wrote:
Hello, I want to know that what is layout in view page of nopcommerce which given the path of other view page.
Hi Karan,
Layout page is a concept of ASP.NET MVC and not of nopCommerce, I would like to rephrase your sentence. It is
not gives you a path of another view page but that's indicate
Master Page of your current view.
sksoni wrote:
like in index.cshtml there is Layout = "~/Views/Shared/_ColumnsOne.cshtml";
Now, my question is that why this other cshtml path has given and if I remove this line then there is no change in nopcommerce.
Now, the question is if you removed it from
_ColumnsOne.cshtml then why it doesn't affect any!!
If you observe there is a view page (
_ViewStart.cshtml) at Nop.Web > Views. Which has code as below.
@{
Layout = "~/Views/Shared/_ColumnsOne.cshtml";
}
_ViewStart.cshtml that which one is our default master layout. if you removed from here, it will appear changes to front side.
_ViewStart.cshtml is concept of MVC. Razor View Engine introduced a new layout named _ViewStart which is applied on all view automatically. Razor View Engine firstly executes the _ViewStart and then start rendering the other view and merges them.
Hope this helps!