javascript - “WebFormsBundle”不是有效的脚本名称。名称必须以 '.js' 结尾

标签 javascript .net visual-studio

我该怎么做才能解决这个错误?

enter image description here

一开始应用程序没问题,但我不知道发生了什么。 我已经正确地安装了软件包和引用资料。

这是我理解的错误部分

      <asp:ScriptManager runat="server">
        <Scripts>
            <%--To learn more about bundling scripts in ScriptManager see 
       http://go.microsoft.com/fwlink/?LinkID=301884 --%>
            <%--Framework Scripts--%>
            <asp:ScriptReference Name="MsAjaxBundle" />
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="bootstrap" />
            <asp:ScriptReference Name="respond" />
            <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/WebForms.js" />
            <asp:ScriptReference Name="WebUIValidation.js" 
     Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
            <asp:ScriptReference Name="MenuStandards.js" 
     Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
            <asp:ScriptReference Name="GridView.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/GridView.js" />
            <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/DetailsView.js" />
            <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/TreeView.js" />
            <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/WebParts.js" />
            <asp:ScriptReference Name="Focus.js" Assembly="System.Web" 
     Path="~/Scripts/WebForms/Focus.js" />
            <asp:ScriptReference Name="WebFormsBundle"/>
            <%--Site Scripts--%>
        </Scripts>
    </asp:ScriptManager>

最佳答案

这个解决方案对我有用:

安装

Microsoft.AspNet.ScriptManager.WebForms

来自 Nuget(右键单击您的解决方案,选择管理 Nuget 包)

关于javascript - “WebFormsBundle”不是有效的脚本名称。名称必须以 '.js' 结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50292422/

相关文章:

c# - 如何部分退款使用 Invoicing SDK 创建的 paypal 发票

c# - 如何从 Web 浏览器控件设置纸张大小和边距打印

c++ - 如何让 VS2010 更喜欢一个包含目录而不是另一个?

Javascript 和 AJAX,仅在使用 alert() 时有效

javascript - <select> 要求不工作

javascript - 缓存异步函数的结果,并将其传递给 Async.js 中的下一个函数

c# - 在 NetworkCredentials 中提供用户名和密码时,.net 中的 HttpClient 发出 2 个请求

javascript - WebPack 在构建开始前执行函数

C# - 获取源代码文件正在使用或引用的类型列表

c# - 如何添加到 Visual Studio 错误列表窗口中的消息列表?