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

后端 未结 13 2099
遥遥无期
遥遥无期 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:33

    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="
    
                                     
                  
提交回复
热议问题