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,
write index or id of accordion pane in which the button was pressed using ClientScript.RegisterStartupScript
. Suppose user clicks button named btnSubmit
which is in pane 3. Then it will work like this:
protected void btnSubmitClick(object sender, EventArgs e)
{
//process button click
//class this function at end:
SetAccordionPane(3);
}
//you can call this function every time you need to set specific pane to open
//positon
private void SetAccordionPane(int idx)
{
var s=";
ClientScript.RegisterStartupScript(typeof(, s);
}
now in javascript:
$(function(){
if(paneIndex)
{
$('.selector').accordion({active: paneIndex});
}
else
{
$('.selector').accordion();
}
});