【问题标题】:Only one instance of a ScriptManager can be added to the page: issue with Ajax Toolkit?只能将 ScriptManager 的一个实例添加到页面中:Ajax Toolkit 有问题吗?
【发布时间】:2013-01-07 15:09:29
【问题描述】:

我在 Visual Studio 2012 上。我需要为我的网站添加 CollapsablePanelExtender。因为 MasterPage 上有一个 ScriptManager,所以我不知道如何在 ToolkitScriptManager 中添加。当我尝试使用 Scriptmanagerproxy 时,web.config 崩溃并告诉我必须使用 ToolkitScriptManager。当我将我的 toolkitscriptmanager 与母版页的 scriptmanager 一起使用时,该站点也崩溃并说找不到 ToolkitScriptManager,并且“只允许一个 ScripManager 实例。

我在masterPage上有以下代码:

<asp:ScriptManager runat="server">
    <Scripts>
        <%--Framework Scripts--%>
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="jquery.ui.combined" />
        <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>

我有以下代码可以在实际页面中使用。

 <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"></asp:ToolkitScriptManager>
<h3>We suggest the following:</h3>
<ol class="round">
    <li class="one">
        <asp:Panel ID="pnlRec" runat="server"><h5>Getting Started with Recreation</h5><br />
            <asp:Label ID="lblMsg" runat="server" Text="Label"></asp:Label></asp:Panel>
        <asp:Panel ID="cpnlRec" runat="server"><table><tr>
                <td>Stuff</td><td>Stuff</td><td>Stuff</td>
                   </tr></table></asp:Panel>
        <asp:CollapsiblePanelExtender  ID="cpeRec" runat="server"  CollapseControlID="pnlClick" Collapsed="True" ExpandControlID="pnlClick" CollapsedText="Show" ExpandedText="Hide" TextLabelID="lblMsg" TargetControlID="cpnlRec">

        </asp:CollapsiblePanelExtender>

【问题讨论】:

    标签: asp.net visual-studio-2012 master-pages scriptmanager toolkitscriptmanager


    【解决方案1】:

    检查 Designer.cs 文件并确认您没有对 toolkitscriptmanager 的任何其他引用。如果发现删除这些引用。清理它并构建它。这可能是错误的原因。

    【讨论】:

      猜你喜欢
      • 2012-06-24
      • 2012-01-14
      • 2017-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多