Search code examples
c#asp.net-mvcasp.net-coremodel-view-controller

When i try to merge Layout page But it shown as an error


An unhandled exception occurred while processing the request. InvalidOperationException: The following sections have been defined but have not been rendered by the page at '/Views/Shared/_HomeLayout.cshtml': 'Scripts'. To ignore an unrendered section call IgnoreSection("sectionName"). Microsoft.AspNetCore.Mvc.Razor.RazorPage.EnsureRenderedBodyOrSections()

i tried to given view page to layout but the layout page render section showned as error enter image description here


Solution

  • @RenderSection("Scripts", required: false)