简体   繁体   English

只能将ScriptManager的一个实例添加到页面:Ajax Toolkit出现问题?

[英]Only one instance of a ScriptManager can be added to the page: issue with Ajax Toolkit?

I am on visual studio 2012. I need to add in the CollapsablePanelExtender for my site. 我使用的是Visual Studio2012。我需要为我的站点添加CollapsablePanelExtender。 Because there is a ScriptManager on the MasterPage, I cannot figure out how I can add in the ToolkitScriptManager. 因为在母版页上有一个ScriptManager,所以我无法弄清楚如何在ToolkitScriptManager中添加。 When I try to use Scriptmanagerproxy, the web.config crashes and tells me I must use ToolkitScriptManager. 当我尝试使用Scriptmanagerproxy时,web.config崩溃并告诉我必须使用ToolkitScriptManager。 When I use my toolkitscriptmanager with the master page's scriptmanager, the site also crashes and says ToolkitScriptManager cannot be found, and "only one instance of ScripManager is allowed. 当我将我的toolkitscriptmanager与母版页的scriptmanager一起使用时,该站点也崩溃并说找不到ToolkitScriptManager,并且“仅允许使用ScripManager的一个实例。

I have the following code on the masterPage: 我在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>

And I have the following code to be used in an actual page. 我有以下代码要在实际页面中使用。

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

Check the Designer.cs file and confirm that you don't have any other reference to toolkitscriptmanager. 检查Designer.cs文件,并确认您没有对toolkitscriptmanager的其他引用。 if found remove those references. 如果找到,请删除这些引用。 Clean it and build it. 清洁并建造它。 It might be the reason for Error. 这可能是错误的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 只有一个scriptmanager实例可以添加到页面Ajax + Telerik中 - only one instance of a scriptmanager can be added to the page Ajax + Telerik 只能将ScriptManager的一个实例添加到页面 - Only one instance of a ScriptManager can be added to the page 只能将一个ScriptManager实例添加到页面中 - Only one instance of a ScriptManager can be added to the page 页面中只能添加一个 ScriptManager 实例 - Only one instance of a ScriptManager can be added to the page 只能将ScriptManager的一个实例添加到页面 - Only one instance of a ScriptManager can be added to the page 只能将ScriptManager的一个实例添加到页面 - Only one instance of a ScriptManager can be added to the page 母版页-只能将ScriptManager的一个实例添加到该页中 - Master page - Only one instance of a ScriptManager can be added to the page MultiHandleSliderExtender:错误-只能将ScriptManager的一个实例添加到页面 - MultiHandleSliderExtender: Error - Only one instance of a ScriptManager can be added to the page 只能将ScriptManager的一个实例添加到页面错误中 - Only one instance of a ScriptManager can be added to the page error System.InvalidOperationException:只能将ScriptManager的一个实例添加到页面 - System.InvalidOperationException: Only one instance of a ScriptManager can be added to the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM