【问题标题】:'WebFormsBundle' is not a valid script name. The name must end in '.js'“WebFormsBundle”不是有效的脚本名称。名称必须以“.js”结尾
【发布时间】:2018-05-11 12:31:50
【问题描述】:

我能做些什么来解决这个错误?

起初应用程序还可以,但我不知道发生了什么。 我已经正确安装了软件包和参考资料。

这是我理解的错误部分

      <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>

【问题讨论】:

  • 你曾经解决过这个问题吗?我现在遇到了同样的问题。
  • 我也面临同样的问题,无法从任何地方找到解决方案。如果您已解决此问题,请分享解决方案。

标签: javascript .net visual-studio


【解决方案1】:

这个解决方案对我有用:

安装

Microsoft.AspNet.ScriptManager.WebForms

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

【讨论】:

    【解决方案2】:

    我终于自己解决了,按照下面的步骤来解决问题。

    1. 通过在包管理器控制台中执行以下命令来安装 Microsoft.ScriptManager.WebForms 包(如果尚未安装)

    安装包 Microsoft.ScriptManager.WebForms -Version 1.0.1

    1. 然后通过在包管理器控制台中执行以下命令重新安装它

    update-Package -reinstall Microsoft.ScriptManager.WebForms

    【讨论】:

      猜你喜欢
      • 2013-02-05
      • 1970-01-01
      • 2019-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-07
      • 2019-10-04
      相关资源
      最近更新 更多