title: Recover selected tab after postback with Bootstrap
body: <p>I'm using tabs on Bootstrap: in this example I have 4 tabs and use some ASP.NET WebControls within them, like DropdownLists, Buttons and TextBoxes.
  When I select dropdownlist item or click a buttons, lost previous and actual selected tab state and cannot recover it.  </p>
  
  <pre><code>&lt;script src="/Scripts/bootstrap-tabs.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script&gt;
     $(function(){
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        // Get the name of active tab
        var activeTab = $(e.target).text(); 
        // Get the name of previous tab
        var previousTab = $(e.relatedTarget).text(); 
        $(".active-tab span").html(activeTab);
        $(".previous-tab span").html(previousTab);
     });
  });
  &lt;/script&gt;
  
  &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
          &lt;ContentTemplate&gt;
          &lt;asp:Panel ID="Panel1" runat="server" GroupingText="Selección Fecha"&gt;    
          &lt;ul id="profileTabs2" class="nav nav-tabs"&gt;
                    &lt;li&gt;&lt;a href="#detallepagosactividad" data-toggle="tab"&gt;uno&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#detallefacturacion" data-toggle="tab"&gt;dos&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#detallefacturacion2" data-toggle="tab"&gt;tres&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#detallefacturacion3" data-toggle="tab"&gt;cuatro&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt; 
          &lt;div class="tab-content" id="myTabContent2"&gt;
                &lt;div id="detallepagosactividad" class="tab-pane fade"&gt;
                    some text
                &lt;/div&gt;
                &lt;div id="detallefacturacion" class="tab-pane fade"&gt;
                    other text
                &lt;/div&gt;
                &lt;div id="detallefacturacion2" class="tab-pane fade"&gt;
                    &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt;
                &lt;/div&gt;
                &lt;div id="detallefacturacion3" class="tab-pane fade"&gt;
                     &lt;asp:Button ID="Button2" runat="server" Text="Button" /&gt;
                &lt;/div&gt;
                &lt;/div&gt;
                &lt;hr&gt;
                      &lt;p class="active-tab"&gt;&lt;strong&gt;Active Tab&lt;/strong&gt;: &lt;span&gt;&lt;/span&gt;&lt;/p&gt;
                       &lt;p class="previous-tab"&gt;&lt;strong&gt;Previous Tab&lt;/strong&gt;: &lt;span&gt;&lt;/span&gt;&lt;/p&gt;
                &lt;hr&gt;
          &lt;/asp:Panel&gt;
          &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
  </code></pre>