Understanding MVC tags for nopCommerce
Asked Answered
Y

1

7

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.

Yardarm answered 9/9, 2013 at 5:21 Comment(1)
in addition to the nathan's answer. @Html.widget implements a function using Action methot in system.web.mvc.HtmlHelper namespace. if you right click and choose "go to definition", you will see it. Inside the function, 2nd parameter refers to the controller name and 1st one is the action method. for example, return helper.Action("WidgetsByZone", "Widget", new { widgetZone = widgetZone, additionalData = additionalData }); rest are the aditional parameters.Phototypy
G
4

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.

Guiscard answered 9/9, 2013 at 6:8 Comment(1)
@Html.Widget is an extension helper from nopcommerce.Gyrus

© 2022 - 2024 — McMap. All rights reserved.