我正在使用MS AJAX的手风琴控制。它工作正常,但我似乎无法使用UpdatePanel。我的布局是这样的:
<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>
单击按钮时会发生回发,但更新面板永远不会刷新或更新。我尝试在每个回发事件的代码隐藏中添加UpdatePanel1.Update()
,但没有运气。关于为什么会发生这种情况的任何想法?
由于
答案 0 :(得分:0)
我设法解决了这个问题。对于遇到类似问题的人,我在ScriptManager中添加了一个额外的脚本引用:
<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxWebForms.js" />