title: TabContainer Problems
body: <p>Having a strange issue with the TabContainer in the AJAX Toolkit.</p>
  
  <p>We have several views into a customer record system that we have built as ASP.net controls. These controls use UpdatePanels to load data asynchronously.  We use jQuery and jquery.ui to place these controls in separate tabs on a single page. </p>
  
  <p>Which all works swimmingly. </p>
  
  <p>Lately, I've gotten a little tired of the jQuery tab hackish approach and decided to port everything to use the TabContainer. I want to be able to control the tabs as objects. </p>
  
  <p>At first glance, everything works perfectly. I just slapped the controls into tabs in a TabContainer and everything looked great. However, for some reason, databound controls are losing their data.</p>
  
  <p>For instance, grid views vanish when I switch pages.  A drop down control with an OnTextChanged event, loses its databound list of values upon post back. </p>
  
  <p>Something about the TabContainer -> Custom Control -> UpdatePanel -> Control that uses data binding heirarchy is throwing it out of whack and the debugger isn't shedding any light. It seems like control state isn't being stored. </p>
  
  <p>I don't really know enough about control state to know what to look for.</p>
  
  <p>Any ideas? Here is the markup for the TabContainer:</p>
  
  <pre><code>&lt;asp:TabContainer ID="tcBanner" runat="server" ActiveTabIndex="0" Width="100%" 
      EnableViewState="False" ScrollBars="Vertical"&gt;
      &lt;asp:TabPanel runat="server" HeaderText="Comments" ID="tbComments"&gt;
          &lt;ContentTemplate&gt;
              &lt;luBannerControl:Comments ID="commentsTabContent" runat="server" /&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;        
      &lt;asp:TabPanel runat="server" HeaderText="General" ID="tbContact"&gt;
          &lt;ContentTemplate&gt;
              &lt;luBannerControl:Contact ID="contactTabContent" runat="server" /&gt;
          &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;
  &lt;/asp:TabContainer&gt;
  </code></pre>
  
  <p>Here is the markup for one of the controls:</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="pnlComments" UpdateMode="Conditional" runat="server"&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:GridView ID="CommentsGridView" AllowPaging="true" PageSize="20" DataSourceID="BannerSqlDataSource" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="CommentGrid" HeaderStyle-CssClass="CommentGridHeader" RowStyle-CssClass="CommentRowsEven" AlternatingRowStyle-CssClass="CommentRowsOdd"&gt;
              &lt;Columns&gt;
                  &lt;asp:BoundField DataField="SPRCMNT_TEXT" HeaderText="Comment" SortExpression="SPRCMNT_TEXT" /&gt;
                  &lt;asp:BoundField DataField="SPRCMNT_DATE" HeaderText="Created" SortExpression="SPRCMNT_DATE" DataFormatString="{0:M/dd/yyyy}" /&gt;
                  &lt;asp:BoundField DataField="SPRCMNT_CMTT_CODE" HeaderText="Type" SortExpression="SPRCMNT_CMTT_CODE" /&gt;
                  &lt;asp:BoundField DataField="SPRCMNT_CTYP_CODE" HeaderText="Source" SortExpression="SPRCMNT_CTYP_CODE" /&gt;
                  &lt;asp:BoundField DataField="sprcmnt_user_id" HeaderText="User" SortExpression="sprcmnt_user_id" /&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
      &lt;/ContentTemplate&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="txtSearch" EventName="TextChanged" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="btnClearFilter" EventName="Click" /&gt;
      &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>