ASP.MVC execute/connection scripts Section already defined: "Menu". what does it mean?

0 like 0 dislike
12 views
When you open the page project asp.mvc error: Section already defined: "Menu"

Swears by plug-in 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 the Section already defined and how to fix it?
by | 12 views

1 Answer

0 like 0 dislike
Page structure is usually set in the _Layout.cshtml (may be set directly in the view or controller), it indicates which sections can/should be rendered and where (@RenderSection("scripts", required: false)). When rendering the page section with the same name may not occur more than once. Probably You have the partition definition (@section Menu) appears more than once. Check which Layout is used, which sections are set and there are no repetitions of these sections in the Layout View and the Partial View used to render this page.
by

Related questions

0 like 0 dislike
2 answers
asked May 21, 2019 by romanchenkoalexey
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
32,872 users