title: How to load ui tab content on ajax call using asp.net razor
body: <p>I have a page that has a lot of (necessary) tabs, so it does a lot of calls to get the info but I only want to get that information only if that tab is clicked.</p>
  
  <p>I have something like this:</p>
  
  <pre><code>&lt;ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"&gt;
      &lt;li class="ui-state-default ui-corner-top"&gt;&lt;a class="ui-tabs-anchor" href="#listing-global-view"&gt;@Resources.GetResourceString("Strings", "GlobalView")&lt;/a&gt;&lt;/li&gt;
      ...
  &lt;/ul&gt;
  
  &lt;div id="listing-global-view" class="startup-active ui-tabs-panel ui-widget-content ui-corner-bottom"&gt;
      @{Html.RenderPartial("ListingGlobalView", Model);}
  &lt;/div&gt;
  </code></pre>
  
  <p>Then my script initializes the tabs, but I only want the content associated to each tab when it's clicked.</p>
  
  <pre><code>$('.tabbedwidget').tabs({
          active: 0,
          activate: function (event, ui) {
              var selectedSelector = ui.newPanel.selector; //ui.newTab[0].innerText;
              switch (selectedSelector)
              {
                  case "#listing-global-view": {
                      //make ajax equivalent to @{Html.RenderPartial("ListingGlobalView", Model);}
  
                  }
              }
  
          }
      });
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Now I have another problem: since I only want the info associated to that tab be rendered on click, I changed the href tag to the action that renders the partial.</p>
  
  <pre><code>&lt;ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"&gt;
      &lt;li class="ui-state-default ui-corner-top"&gt;&lt;a class="ui-tabs-anchor" href="@Url.Action("ListingGlobalView", new { id = Model.ID })"&gt;@Resources.GetResourceString("Strings", "GlobalView")&lt;/a&gt;&lt;/li&gt;
      ...
  &lt;/ul&gt;
  </code></pre>
  
  <p>When the tab is clicked it shows properly my partial view but inside this partial, I'm calling another partial that was supposed to call another actions (to fill combo information - json), but they're not doing it. The info only comes correctly when I say at my controller the 1st partial rendered is a view, but that way it renders me the layout...</p>
  
  <p>Thanks.</p>