title: asp.net jquery tabs and updatepanels
body: <p>I'm using asp.net together with jquery. In Default.aspx I have implemented some jquery-tabs that load their data with ajax call. They load another asp.net page MyTab.aspx. My problem is that when I navigate in the tab (MyTab.aspx) it always reloads the full page (whole Default.aspx) but I only want it to reload inside the tab. For example when adding an item I just want the tab to reload. </p>
  
  <p>So I added a updatepanel inside MyTab.aspx. The problem is now instead that all links on  Default.aspx is broken, it just open the selected tab in the whole window when clicking. Very strange, but I've read that sometimes it can be messy to get updatepanels to work with jquery. </p>
  
  <p>You can see my code below, is there anything I can do different to get it working?</p>
  
  <p>In Default.aspx:   </p>
  
  <pre><code>&lt;html&gt;
      &lt;head runat="server"&gt;
          &lt;script type="text/javascript"&gt;
              $(function() {
                  $('.tabs').tabs();
              }); 
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
          &lt;asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /&gt;
          &lt;div class="tabs"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href="#PanelTab"&gt;Tab0&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href='MyTab.aspx?type=1'&gt;Tab1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href='MyTab.aspx?type=2'&gt;Tab2&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
              &lt;div id="PanelTab"&gt;Content0&lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
      &lt;body&gt;
  &lt;html&gt;
  </code></pre>
  
  <p>In MyTab.aspx:</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;form id="formTab" runat="server"&gt;
              &lt;asp:ScriptManager ID="ScriptManagerTab" runat="server" EnablePartialRendering="true" /&gt;
              &lt;asp:UpdatePanel runat="server" ChildrenAsTriggers="true" ID="UpdatePanelList" UpdateMode="Always"&gt;
                  &lt;ContentTemplate&gt;
                      &lt;asp:SqlDataSource ID="DSTab" 
                          runat="server"
                          DataSourceMode="DataSet"  
                          ConnectionString="XXX"
                          ProviderName="MySql.Data.MySqlClient" 
                          SelectCommand="XXX" 
                          &gt;
                          &lt;SelectParameters&gt;
                              &lt;asp:QueryStringParameter QueryStringField="type" Name="?type" /&gt;
                          &lt;/SelectParameters&gt;
                      &lt;/asp:SqlDataSource&gt;
                      &lt;asp:GridView ID="GridViewTab" DataKeyNames="id" DataSourceID="DSTab" AutoGenerateColumns="false" runat="server" &gt;
                          &lt;Columns&gt;
                              &lt;asp:TemplateField&gt;
                                  &lt;ItemTemplate&gt;
                                      &lt;asp:HyperLink ID="HyperLinkTab" NavigateUrl='Item.aspx' runat="server"&gt;&lt;%# Eval("title")%&gt;&lt;/asp:HyperLink&gt;
                                      &lt;asp:Button OnClick="AddItem" ID="ButtonAddItem" Text="Add" runat="server" /&gt; 
  
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
                          &lt;/Columns&gt;
                      &lt;/asp:GridView&gt;
                      &lt;asp:Button OnClick="CreateNewItem" ID="ButtonCreateNewItem" Text="Create New" runat="server" /&gt; 
                  &lt;/ContentTemplate&gt;
              &lt;/asp:UpdatePanel&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>