Exception-User 未处理/System.Web.HttpException

Exception-User Unhandled / System.Web.HttpException

我正在创建 asp.net 网络 api,我正在尝试通过 date-time 选择器在其中一个字段中添加日历控件。在我 运行 应用程序并按下创建 article/event 的按钮后,它显示此错误: System.Web.HttpException: 'Section already defined: "scripts".'

这是我的_Layout.cshtml

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - Public Events</title>
    @Styles.Render("~/Content/css")
    @RenderSection("styles", required: false)
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")

</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Events", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    @if (Request.IsAuthenticated)
                    {
                        <li>@Html.ActionLink("My Events", "My", "Events")</li>
                        <li>@Html.ActionLink("Create Event", "Create", "Events")</li>
                    }
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>
    <div class="container body-content">
        @Html.Partial("_Notifications")
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - Events Application</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
    
</body>
</html>

脚本部分定义了两次。删除一个或合并它们。

    @section scripts 
    { 
        //... 
    }