Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding MVC tags for nopCommerce

I am new to MVC , and in the application i downloaded and trying to debug i see this mark up

@Html.Widget("body_start_html_tag_after")
@Html.Partial("_Notifications")
@Html.Action("AdminHeaderLinks", "Common")

What does this mean?, @Html.Partial where can I find where the value "body_start_html_tag_after") is defined ?

And this one:

<div class="master-wrapper-main">
    @RenderBody()
</div>

Where can i find what @RenderBody does?, this is in a .cshtml file.

like image 497
jedgard Avatar asked Sep 09 '13 05:09

jedgard


1 Answers

I would suggest that you look at a reference like http://www.asp.net/mvc to gain a greater understanding of ASP.Net MVC. Having said that the @HTML.Widget, etc is server side code that gets called during the HTML generation process.

I have heard of nopCommerce but I am unfamiliar with the structure, but @Html is usually used for server side helper methods.

@Html.Partial("_Notifications") is used to add the _Notifications Partial view to the page being rendered.

@Html.Action method will render a html A tag with the href link to the controller and action to be performed.

@Html.Widget I am unfamiliar with but one could assume that it is a helper method.

@RenderBody is used on a master page (usually the shared/_Layout.cshtml) as a server side marker to render the view that comes from the associated controller.

like image 132
Nathan Fisher Avatar answered Nov 02 '22 21:11

Nathan Fisher