Render Body Error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 11 ans
I am facing this error while compiling nopcommerce default site
"The "RenderBody" method has not been called for layout page "~/Views/Shared/_Root.cshtml" "

any one please help me out.
Il y a 11 ans
in _Root.cshtml there should be a call to RenderBody

@RenderBody()


Maybe you override _Root.cshtml in your theme and the call got lost?
Il y a 11 ans
My code is this

@{
    Layout = "~/Views/Shared/_Root.Head.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "body_start_html_tag_after" })
@Html.Partial("_Notifications")
<div class="master-wrapper-page">
    @Html.Action("JavaScriptDisabledWarning", "Common")
    <div class="master-wrapper-content">
        <script type="text/javascript">
        //<![CDATA[
            //replace the first parameter with "true" to use popup notifications
            AjaxCart.init(false, '.header-links .cart-qty', '.header-links .wishlist-qty', '#flyout-cart');
          //]]>
        </script>
        @Html.Partial("Header")
        @Html.Partial("HeaderMenu")
        @Html.Partial("ContentPage")
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "content_before" })
        @*ajax loading window
        <div class="ajax-loading-block-window" style="display: none">
            <div class="loading-image">
            </div>
        </div>
        @RenderBody()
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "content_after" })
        @Html.Action("EuCookieLaw", "Common")
    </div>*@
    @Html.Action("Footer", "Common")
</div>
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "body_end_html_tag_before" })


please help
Il y a 11 ans
The @RenderBody is already called.

so what to do next???
Il y a 11 ans
You have the the code commented out (between the ajax loading window comment up until the div just after 'EuCookieLaw) and thats why there is no call to RenderBody. The correct code is

@{
    Layout = "~/Views/Shared/_Root.Head.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "body_start_html_tag_after" })
@Html.Partial("_Notifications")
<div class="master-wrapper-page">
    @Html.Action("JavaScriptDisabledWarning", "Common")
    <div class="master-wrapper-content">
        <script type="text/javascript">
        //<![CDATA[
            //replace the first parameter with "true" to use popup notifications
            AjaxCart.init(false, '.header-links .cart-qty', '.header-links .wishlist-qty', '#flyout-cart');
          //]]>
        </script>
        @Html.Partial("Header")
        @Html.Partial("HeaderMenu")
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "content_before" })
        @*ajax loading window*@
        <div class="ajax-loading-block-window" style="display: none">
            <div class="loading-image">
            </div>
        </div>
        @RenderBody()
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "content_after" })
        @Html.Action("EuCookieLaw", "Common")
    </div>
    @Html.Action("Footer", "Common")
</div>
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "body_end_html_tag_before" })
Il y a 11 ans
Yahooooooo :)

yes thanks :)

I have removed commented lines and now my site is running back :)

Thanks again i was facing this error from 2 hours....
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.