views:

21

answers:

0

Hi All,

To implemt tab JQuery is used

<script type="text/javascript">
   $(document).ready(function() {

  $('#tabs div').hide(); // Hide all divs

      $('#tabs ul li a').click(function() { //When any link is clicked
          $('#tabs ul li').removeClass('active'); // Remove active class from all links
          $(this).parent().addClass('active'); //Set clicked link class to active
          var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
          $('#tabs div').hide(); // Hide all divs
          $(currentTab).show(); // Show div with id equal to variable currentTab


          return false;
      });
  });

Actual tags are:

 <div id="tabs">
                      <ul>
                          <li><a href="#tab-1">Create Model</a></li>
                          <li><a href="#tab-2">Clone Model</a></li>
                    </ul>
                <div id="tab-1">

                </div>
                <div id="tab-2">

<%= Html.DropDownList("ModelCode", (SelectList)ViewData["ddlModels"],"--Select--", new {id="ddlModel" })%>

I want to disaplay tab-1 if the request has gone to controller from tag-1 . If it's tag-2 then next time displyaing tag-2.

The JQuery code always displays tag-1. Is there any way to decide which tag to display.

Any help would be appreciated.