我使用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>

有当我点击按钮发生回发,但在UpdatePanel从未刷新或更新。我试图在代码隐藏每次回发事件,但没有运气加UpdatePanel1.Update()。任何想法,为什么发生这种情况?

由于

有帮助吗?

解决方案

我设法解决这个问题。对于那些谁碰到类似的问题,我加入我的ScriptManager一个额外的脚本引用:

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxWebForms.js" />
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top