Keep the current jQuery accordion pane open after ASP.NET postback?

后端 未结 13 2132
遥遥无期
遥遥无期 2020-12-09 09:57

I have a jquery accordion on an asp.net aspx weppage. Inside the panes, I have asp.net buttons. When I click on the button, the pane I was in, closes and reloads the page,

13条回答
  •  情书的邮戳
    2020-12-09 10:24

    I had the same issue I came here. 1. MaxCarey answer was looking good enough to solve the issue but unfortunately I did not have ID for my accordions. (I was using a third party template, they just use css class). 2. Imran H. Ashraf was also good but same problem no access to the accordion by ID.

    My Problem: 1. I had a DetailsView in an accordion with Edit Update Cancel command. 2. When I click on Edit button it works but my accordion get closed.

    My Solution: 1. I put one ScriptManager on my form. 2. I put one UpdatePanel inside my accordion. 3. I put my DetailsView inside the UpdatePanel. 4. That's it, no coding, no code behind and it works fine.

    Here is the html markup:

    Hope it might help someone.

    Thanks Happy Coding

提交回复
热议问题