工具包脚本管理器.cs未找到

本文关键字:cs 脚本 管理器 工具包 | 更新日期: 2023-09-27 17:55:15

我很抱歉提出另一个,但我已经尝试了所有使AjaxControlToolkit工作的方法,我已经尝试了将其添加到web.config的方法

<pages>
  <controls>
      <add tagPrefix="asp"
                 namespace="AjaxControlToolkit"
                 assembly="AjaxControlToolkit" />
  </controls>
</pages>

但它一直说我只能有一个脚本管理器实例(我确保它删除

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> 

)。但是我仍然收到相同的错误。我试过了,只是在

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

但随后它说它找不到工具包脚本管理器.cs。有谁知道发生了什么。我正在 ASP.NET 网络表单中执行此操作。

工具包脚本管理器.cs未找到

发现问题,因为母版页中有一个脚本管理器,如果您将其放在 web.config 中。

<pages>
 <controls>
  <add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
 </controls>
</pages>

它会告诉你,你有 2 个脚本管理器实例。因此,您必须将主文件中的脚本管理器修改为:

<ajaxToolkit:ToolkitScriptManager runat="server">
<Scripts>
    <asp:ScriptReference Name="jquery" />
    <asp:ScriptReference Name="jquery.ui.combined" />
    <asp:ScriptReference Name="WebForms.js" Path="~/Scripts/WebForms/WebForms.js" />
    <asp:ScriptReference Name="WebUIValidation.js" Path="~/Scripts/WebForms/WebUIValidation.js" />
    <asp:ScriptReference Name="MenuStandards.js" Path="~/Scripts/WebForms/MenuStandards.js" />
    <asp:ScriptReference Name="GridView.js" Path="~/Scripts/WebForms/GridView.js" />
    <asp:ScriptReference Name="DetailsView.js" Path="~/Scripts/WebForms/DetailsView.js" />
    <asp:ScriptReference Name="TreeView.js" Path="~/Scripts/WebForms/TreeView.js" />
    <asp:ScriptReference Name="WebParts.js" Path="~/Scripts/WebForms/WebParts.js" />
    <asp:ScriptReference Name="Focus.js" Path="~/Scripts/WebForms/Focus.js" />
    <asp:ScriptReference Name="WebFormsBundle" />
</Scripts>

这应该会停止错误。