maintain tab after post back jquery

Hi I tried in different ways but not working can any one help me

<script src="../Scripts/jquery1.9.1.js"></script>
<script src="../Scripts/jquery-ui.js"></script>
<div id="tabContainer">
    <asp:HiddenField ID="tab_index" runat="server" />
    <ul>
        <li><a href="#tabs-1">Tab 1</a>
        </li>
        <li><a href="#tabs-2">Tab 2</a>
        </li>
        <li><a href="#tabs-3">Tab 3</a>
        </li>
    </ul>
    <div id="tabs-1">
        <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />
    </div>
    <div id="tabs-2">
        <asp:Button ID="Button2" runat="server" Text="Submit" OnClick="Button2_Click" style="height: 26px" />
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
            <asp:ListItem>3</asp:ListItem>
            <asp:ListItem>4</asp:ListItem>
        </asp:DropDownList>
    </div>
    <div id="tabs-3">
        <asp:Button ID="Button3" runat="server" Text="Submit" OnClick="Button3_Click" />
    </div>
</div>

i follow different link but after post back it retains to tab1 but not tab2

Answers


easiest way to make a custom query and read the query string ..open that particular tab on the basis of query string value.

JavaScript function for extracting query string value:

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

Example:

    http://asp.net?tab=2
      var qstr = getParameterByName('tab');   
       if(qstr=='2')
        ...Opne particular tab   Or make it dynamic

Need Your Help

Overriding a:hover text-decoration in a different class

css class override

I have all links on my site underlined when hovered using the following css:

Vim Plugin: Follow Symbol under Cursor

vim

Is there a vim plugin that allows you to place the cursor over a function and have a plugin run a script that searchs a tag or some other entity for where that function is defined. Or perhaps it pr...