0

私はMSAJAXのアコーディオンコントロールを使用しています。正常に動作しますが、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()ポストバックイベントごとにコードビハインドを追加しようとしましたが、うまくいきませんでした。なぜこれが起こっているのかについてのアイデアはありますか?

ありがとう

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 に答える