0

我正在使用 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()为每个回发事件添加代码隐藏,但没有运气。关于为什么会发生这种情况的任何想法?

谢谢

4

1 回答 1

0

我设法解决了它。对于那些遇到类似问题的人,我在我的 ScriptManager 中添加了一个额外的脚本参考:

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxWebForms.js" />
于 2010-03-23T21:50:15.747 回答