单击按钮时打开ajax手风琴窗格

时间:2022-10-03 21:16:06

How to open accordion pane with fade transition effect when I click a button? I tried to code it in server side, it is working but there is no fadetransition.

单击按钮时如何打开带有淡入过渡效果的手风琴窗格?我尝试在服务器端编写代码,它正在工作,但没有淡入淡出过渡。

here is my code...

这是我的代码......

protected void Button1_Click(object sender, EventArgs e)
{
        Accordions.FadeTransitions = true;
        Accordions.SelectedIndex = 1;    
}

1 个解决方案

#1


1  

You need to switch selected pane on client.

您需要在客户端上切换选定的窗格。

<asp:Button runat="server" Text="Click Me" OnClientClick="switchPane(1); return false;" />

<script type="text/javascript">
     function switchPane(index) {
          $find("<%= Accordions.ClientID %>_AccordionExtender").set_SelectedIndex(index);
     }
</script>

This approach disables server-side client event.

此方法禁用服务器端客户端事件。

#1


1  

You need to switch selected pane on client.

您需要在客户端上切换选定的窗格。

<asp:Button runat="server" Text="Click Me" OnClientClick="switchPane(1); return false;" />

<script type="text/javascript">
     function switchPane(index) {
          $find("<%= Accordions.ClientID %>_AccordionExtender").set_SelectedIndex(index);
     }
</script>

This approach disables server-side client event.

此方法禁用服务器端客户端事件。