title: Ajax TabPanels trigger validation for other tabs in ASP.Net 4.0
body: <p>I have Ajax TabPanel with Tab "Employee List" "Add Employee" "Edit Employee"</p>
  
  <p>On <strong>Employee List</strong> Tab i use gridview to display list of employee along with link Button to view details of employee on same tab and "Del" button to delete employee. It worked fine but when i added Controls to Second tab "Add Employee" along with validation controls. After this gridview in Tab one is not working as it trigger validation on second Tab.</p>
  
  <p>How can i stop this validation which is triggered by controls on Tab 1</p>
  
  <p>Below is the code</p>
  
  <pre><code>   &lt;asp:TabContainer ID="TabContainer1" runat="server" Height="320px" Width="100%" 
          ActiveTabIndex="0" &gt;
      &lt;asp:TabPanel ID="atpEmployeeList" runat="server"   &gt;
      &lt;HeaderTemplate&gt;Employee List&lt;/HeaderTemplate&gt;
      &lt;ContentTemplate&gt;
      &lt;table border="0"  width="100%" cellpadding="0" cellspacing="0"&gt;
      &lt;tr&gt;
      &lt;td class="style1" align="left" valign="top"&gt;
      &lt;b&gt;Employee List&lt;/b&gt;
              &lt;asp:GridView ID="gvEmployeeList" runat="server" AutoGenerateColumns="False" 
              DataKeyNames="eCode" BackColor="White" BorderColor="#336666" 
              BorderStyle="None" BorderWidth="2px" CellPadding="4" 
              GridLines="Horizontal" onrowcommand="gvEmployeeList_RowCommand" 
              onrowdatabound="gvEmployeeList_RowDataBound"  &gt;
              &lt;Columns&gt;
                  &lt;asp:BoundField DataField="eSno" HeaderText="ID" InsertVisible="False" 
                      ReadOnly="True" SortExpression="eSno" /&gt;
                  &lt;asp:BoundField DataField="eFirstName" HeaderText="First Name" 
                      SortExpression="eFirstName" /&gt;
                  &lt;asp:BoundField DataField="eLastName" HeaderText="Last Name" 
                      SortExpression="eLastName" /&gt;
                  &lt;asp:BoundField DataField="eDepartment" HeaderText="Department" 
                      SortExpression="eDepartment" /&gt;
                  &lt;asp:BoundField DataField="eSalary" HeaderText="Salary" 
                      SortExpression="eSalary" /&gt;
     &lt;asp:TemplateField HeaderText="Details"&gt;
       &lt;ItemTemplate&gt;
         &lt;asp:LinkButton ID="lnkBtnEmpDetails" CommandArgument='&lt;%# Eval("eSno") %&gt;' CommandName="ViewDetails" runat="server"&gt;
           View&lt;/asp:LinkButton&gt;
       &lt;/ItemTemplate&gt;
     &lt;/asp:TemplateField&gt;
     &lt;asp:TemplateField HeaderText="Delete"&gt;
       &lt;ItemTemplate&gt;
         &lt;asp:LinkButton ID="lnkBtnEmpDelete" CommandArgument='&lt;%# Eval("eSno") %&gt;' CommandName="Delete" runat="server"&gt;
           Del&lt;/asp:LinkButton&gt;
       &lt;/ItemTemplate&gt;
     &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
              &lt;FooterStyle BackColor="White" ForeColor="#333333" /&gt;
              &lt;HeaderStyle BackColor="#336699" Font-Bold="True" ForeColor="White" /&gt;
              &lt;PagerStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Right" /&gt;
              &lt;RowStyle BackColor="White" ForeColor="#333333" /&gt;
              &lt;SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" /&gt;
              &lt;SortedAscendingCellStyle BackColor="#F7F7F7" /&gt;
              &lt;SortedAscendingHeaderStyle BackColor="#487575" /&gt;
              &lt;SortedDescendingCellStyle BackColor="#E5E5E5" /&gt;
              &lt;SortedDescendingHeaderStyle BackColor="#275353" /&gt;
          &lt;/asp:GridView&gt;
      &lt;/td&gt;
      &lt;td width="250px" align="left" valign="top"&gt;
      &lt;b&gt;Employee Details&lt;/b&gt;
          &lt;br /&gt;
          &lt;table width="280px" align="left" cellpadding="3" cellspacing="0" &gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Code&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblEmpCode" runat="server" &gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Fisrt Name&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblFirstName" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style5" bgcolor="#336699"&gt;
                      Last Name&lt;/td&gt;
                  &lt;td class="style6"&gt;
                      &lt;asp:Label ID="lblLastName" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Designation&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblDesignation" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Department&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblDepartment" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Salary&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblSalary" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Join Date&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblJoinDate" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Phone&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblPhone" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      Address&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblAddress" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style8" bgcolor="#336699"&gt;
                      City&lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:Label ID="lblCity" runat="server"&gt;&lt;/asp:Label&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="style4"&gt;
                      &amp;nbsp;&lt;/td&gt;
                  &lt;td&gt;
                      &amp;nbsp;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;
  
      &lt;asp:TabPanel ID="atpAddEmployee" runat="server" &gt;
      &lt;HeaderTemplate&gt;Add Employee&lt;/HeaderTemplate&gt;
      &lt;ContentTemplate&gt;
      &lt;div&gt;&lt;b&gt;Enter Details of New Employee&lt;/b&gt;&lt;/div&gt;
      &lt;table border="0px"&gt;&lt;tr&gt;
      &lt;td width="400px"&gt;
      &lt;div class="spacer"&gt;&lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAEmpCode" CssClass="txtLabel" runat="server" Text="Code :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtACode" runat="server" CssClass="txt4Digit"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="rfvCode" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtACode"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAFN" CssClass="txtLabel" runat="server" Text="First Name :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtAFN" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtAFN"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblALN" CssClass="txtLabel" runat="server" Text="Last Name :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtALN" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtALN"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblADesignation" CssClass="txtLabel" runat="server" Text="Designation :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtADesignation" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtADesignation"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblADepartment" CssClass="txtLabel" runat="server" Text="Department :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtADepartment" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtADepartment"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblASalary" CssClass="txtLabel" runat="server" Text="Salary :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtASalary" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtASalary"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAJoinDate" CssClass="txtLabel" runat="server" Text="Join Date :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtAJoinDate" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtAJoinDate"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
      &lt;/td&gt;
      &lt;td width="400px"&gt;
          &lt;div class="spacer"&gt;&lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAAddress" CssClass="txtLabel" runat="server" Text="Address :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtAAddress" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtAAddress"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblACity" CssClass="txtLabel" runat="server" Text="City :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtACity" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtACity"&gt;&lt;/asp:RequiredFieldValidator&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblACountry" CssClass="txtLabel" runat="server" Text="Country :"&gt;&lt;/asp:Label&gt;
                          &lt;asp:UpdatePanel ID="updatepanel1" runat="server"&gt;
                              &lt;ContentTemplate&gt;
                              &lt;asp:DropDownList ID="ddCountry" runat="server" CssClass="ddGeneral" DataTextField="Country" 
                                  DataValueField="CountryId" OnSelectedIndexChanged="ddCountry_SelectedIndexChanged"
                                  AutoPostBack="true" AppendDataBoundItems="true" &gt;
                                  &lt;asp:ListItem Value="0"&gt;Select Country&lt;/asp:ListItem&gt;
                              &lt;/asp:DropDownList&gt;
                          &lt;/ContentTemplate&gt;
                      &lt;/asp:UpdatePanel&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAState" CssClass="txtLabel" runat="server" Text="State :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:UpdatePanel ID="updatePnlState" runat="server"&gt;
                      &lt;ContentTemplate&gt;
                      &lt;asp:DropDownList ID="ddState" runat="server" CssClass="ddGeneral" DataTextField="Region" DataValueField="RegionId" AppendDataBoundItems="true"&gt;
                      &lt;asp:ListItem Value="0"&gt;Select State&lt;/asp:ListItem&gt;
                      &lt;/asp:DropDownList&gt;
                  &lt;/ContentTemplate&gt;
                  &lt;/asp:UpdatePanel&gt;
                  &lt;asp:UpdateProgress ID="updProgLoading" runat="server" &gt;
                  &lt;ProgressTemplate&gt;
                      &lt;img src="images/ajax-loader-small.gif" align="left" alt="Loading..." vspace="0"  /&gt;&amp;nbsp;
                  &lt;/ProgressTemplate&gt;
                  &lt;/asp:UpdateProgress&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblALL" CssClass="txtLabel" runat="server" Text="Landline :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtALL" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAMobile" CssClass="txtLabel" runat="server" Text="Mobile :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtAMobile" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
             &lt;/div&gt;
             &lt;div class="row"&gt;
                  &lt;asp:Label ID="lblAEmail" CssClass="txtLabel" runat="server" Text="Email :"&gt;&lt;/asp:Label&gt;
                  &lt;asp:TextBox ID="txtAEmail" runat="server" CssClass="txtbox"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="*" 
                      ControlToValidate="txtAEmail"&gt;&lt;/asp:RequiredFieldValidator&gt;
      &lt;/div&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td colspan="2" align="center" height="40px"&gt;
  
          &lt;asp:Button ID="btnAddEmployee" runat="server" Text="Add Employee" 
              CssClass="btn" onclick="btnAddEmployee_Click" /&gt; &lt;input id="Reset1" type="reset" class="btn" value="Reset" /&gt;
      &lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
     &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;
  
      &lt;asp:TabPanel ID="atpEditEmployee" runat="server" &gt;
      &lt;HeaderTemplate&gt;Edit Employee&lt;/HeaderTemplate&gt;
                  &lt;ContentTemplate&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
                      &lt;input id="Button2" type="button" value="Next" onclick="MoveTab(1)" /&gt;
                  &lt;/ContentTemplate&gt;
      &lt;/asp:TabPanel&gt;
  
      &lt;/asp:TabContainer&gt;
  </code></pre>