UpdatePanel não é refrescante em acordeão
-
21-09-2019 - |
Pergunta
Estou usando o controle de acordeão do MS Ajax. Funciona bem normalmente, mas não consigo fazer com que funcione com um UpdatePanel. Meu layout é assim:
<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>
Existem postagens ocorrendo quando clico nos botões, mas o UpdatePanel nunca atualiza ou atualiza. Eu tentei adicionar UpdatePanel1.Update()
No código-behind para cada evento de postback, mas sem sorte. Alguma idéia de por que isso está acontecendo?
Obrigado
Solução
Eu consegui resolvê -lo. Para aqueles que enfrentam questões semelhantes, adicionei uma referência de script extra no meu scriptManager:
<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxWebForms.js" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow