Render Body Error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
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.
11 years ago
in _Root.cshtml there should be a call to RenderBody

@RenderBody()


Maybe you override _Root.cshtml in your theme and the call got lost?
11 years ago
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
11 years ago
The @RenderBody is already called.

so what to do next???
11 years ago
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" })
11 years ago
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.