M
M
mindgrow2018-02-06 12:23:48
JavaScript
mindgrow, 2018-02-06 12:23:48

ASP.MVC script execution/connection - Section already defined: "Menu". - what does this mean?

Error when opening asp.mvc project page: Section already defined: "Menu"
Swears on included scripts
@section Menu {
@Scripts.Render("~/Scripts/Home/DashboardV1/menu")
Styles .Render("~/AdminLTE /plugins/morris/css")
Styles .Render("~/AdminLTE/plugins/jvectormap/css")
Styles .Render("~/AdminLTE/plugins/datepicker/css")
Styles .Render("~/AdminLTE/plugins /daterangepicker/css")
Styles .Render("~/AdminLTE/plugins/bootstrap-wysihtml5/css")
@Scripts.Render("~/AdminLTE/plugins/jquery-ui/js")
@Scripts.Render("~ /AdminLTE/plugins/momentjs/js")
@Scripts.Render("~/AdminLTE/plugins/fullcalendar/js")
}
What does Section already defined mean and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2018-02-07
@mindgrow

The page structure is usually set in the _Layout.cshtml file (can be set directly in the view or controller), which sections can/should be rendered and where (@RenderSection("scripts", required: false)). When rendering a page, a section with the same name cannot occur more than once. You probably have a section definition (@section Menu) multiple times. Check which Layout is being used, which sections are defined there, and whether those sections are repeated in the Layout, View, and Partial View used when rendering this page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question