The "RenderBody" method has not been called for layout page "~/Views/Shared/index.cshtml"
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
how to fix this error
In my case after I add
<div class="container body-content">
@RenderBody()
<hr />
<footer><p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
to the shared layout's footer, all worked perfectly. this occurs because of the layout page on
view -> shared
haven't load the method @RenderBody()
so you can either get rid of this using the upper code fragment or you can just comment the layout at the top of your relevant cshtml page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With