If you use the Renderbody file in the Renderbody file, make it like a layout page.
And add another partial page called MyPartial.cshtml named Layout as _Sistema.cshtml.
Renderbody should only be on the main page. those. layout page.
So your _Sistema.cshtml page should only contain the following:
@RenderBody() @RenderSection("scripts", required: false) @*----Optional---*@
Then your new partial MyPartial.cshtml page should contain the following:
@{ Layout = "~/_Sistema.cshtml"; }
Then use your partial page in your view as follows:
@Html.Partial("MyPartial")
Hope this helps.
Naren source share