私はビジュアル スタジオ 2012 を使用しています。自分のサイトに CollapsablePanelExtender を追加する必要があります。MasterPage に ScriptManager があるため、ToolkitScriptManager に追加する方法がわかりません。Scriptmanagerproxy を使用しようとすると、web.config がクラッシュし、ToolkitScriptManager を使用する必要があると通知されます。マスター ページの scriptmanager で自分の toolkitscriptmanager を使用すると、サイトもクラッシュし、ToolkitScriptManager が見つからないというメッセージが表示され、「ScripManager のインスタンスは 1 つしか許可されていません。
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>