title: How to keep selected tab as active after button click
body: <p>Below is my code </p>
  
  <p>In Update Tab when I select an email id - after return view it set again add tab as active (coz it was set as active by default).</p>
  
  <p>How to set the update tab as active after selecting email id - any idea .</p>
  
  <pre><code>    &lt;ul class="nav nav-tabs"&gt;
      &lt;li role ='presentation' class="active"&gt;&lt;a href="#Add" data-toggle="tab"&gt;Add&lt;/a&gt;&lt;/li&gt;
      &lt;li role ='presentation'&gt;&lt;a href="#Update" data-toggle="tab"&gt;Update&lt;/a&gt;&lt;/li&gt;
      &lt;li role ='presentation'&gt;&lt;a href="#Delete" data-toggle="tab"&gt;Delete&lt;/a&gt;&lt;/li&gt;
      &lt;li role ='presentation'&gt;&lt;a href="#menu3" data-toggle="tab"&gt;Menu 3&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;div class="tab-content"&gt;
      &lt;div id="Add" class="tab-pane active"&gt;
  @using (Html.BeginForm("Add", "Admin"))
  {
      &lt;div class="container container-fluid"&gt;
          &lt;br /&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;
                          &lt;i class="fa fa-user-o" aria-hidden="true"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      @Html.TextBoxFor(m =&gt; m.user_name, new { @class = "form-control", @placeholder = "User Name", @required = "true" })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;
                          &lt;i class="fa fa-address-card-o" aria-hidden="true"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      @Html.TextBoxFor(m =&gt; m.full_name, new { @class = "form-control", @placeholder = "Full Name", @required = "true" })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;
                          &lt;i class="fa fa-inbox" aria-hidden="true"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      @Html.TextBoxFor(m =&gt; m.user_email, new { @class = "form-control", @placeholder = "Email id", @required = "true" })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;
                          &lt;i class="fa fa-lock" aria-hidden="true"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      @Html.TextBoxFor(m =&gt; m.password, new { @class = "form-control", @placeholder = "Password", @required = "true" })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;div class="input-group"&gt;
                      &lt;div class="input-group-addon"&gt;
                          &lt;i class="fa fa-universal-access fa-spin" aria-hidden="true"&gt;&lt;/i&gt;
                      &lt;/div&gt;
                      @Html.DropDownListFor(m =&gt; m.role, ViewBag.role as IEnumerable&lt;SelectListItem&gt;, new { @class = "form-control" })
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                  &lt;button type="submit" class="btn btn-success btn-sm"&gt;
                      &lt;i class="fa fa-check-square-o" aria-hidden="true"&gt;&lt;/i&gt;
                      &amp;nbsp; Add
                  &lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  }
      &lt;/div&gt;
  
      &lt;div id="Update" class="tab-pane"&gt;
  
          @using (Html.BeginForm("Load_data", "Admin")) { 
          &lt;div class="container container-fluid"&gt;
              &lt;br /&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-lg-offset-1 col-lg-5"&gt;
                      &lt;div class="input-group"&gt;
                          &lt;div class="input-group-addon"&gt;
                              &lt;i class="fa fa-users" aria-hidden="true"&gt;&lt;/i&gt;
                          &lt;/div&gt;
                          @Html.DropDownListFor(m =&gt; m.user_email, ViewBag.user_email as IEnumerable&lt;SelectListItem&gt;, new { @class = "form-control",@onchange= "this.form.submit();" })
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          }
  
          &lt;div id="Details"&gt;
              //Details of selected email id will be shown here 
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div id="Delete" class="tab-pane"&gt;
  
      &lt;/div&gt;
  
      &lt;div id="menu3" class="tab-pane"&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>