Asp.net 更新面板在手风琴中不刷新
我用的是MS AJAX的手风琴控件。它工作正常,但我似乎无法让它与UpdatePanel一起工作。我的布局如下:Asp.net 更新面板在手风琴中不刷新,asp.net,updatepanel,repeater,accordion,microsoft-ajax,Asp.net,Updatepanel,Repeater,Accordion,Microsoft Ajax,我用的是MS AJAX的手风琴控件。它工作正常,但我似乎无法让它与UpdatePanel一起工作。我的布局如下: <div id="accordion"> <div><a href="#">Header1</a></div> <div class="acc_content"> <asp:UpdatePanel ID="UpdatePanel1" runat="server
<div id="accordion">
<div><a href="#">Header1</a></div>
<div class="acc_content">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:button id="btnToggle" runat="server" text="toggle"/>
//my repeater contents go here. The buttons within the repeater cause a postback, but changes cannot be seen unless the page is manually refreshed (since the updatepanel doesn't refresh)
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnToggle" EventName="click" />
<asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="click" /> //this button is outside the updatepanel
</ContentTemplate>
</Triggers>
</asp:UpdatePanel>
</div>
<div><a href="#">Header 2 </a></div>
<div class="acc_content">
Content of the second pane
</div>
</div>
单击按钮时会发生回发,但updatepanel从不刷新或更新。我尝试为每个回发事件在代码中添加UpdatePanel1.Update,但没有成功。你知道为什么会这样吗
谢谢,我设法解决了。对于遇到类似问题的人,我在ScriptManager中添加了一个额外的脚本参考:
<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxWebForms.js" />