title: Putting validators disturbs panel layout
body: <p>when i put RequiredFieldValidator in asp.net page then it disturbs page layout. It works in all places but in specific places it disturbs page layout.</p>
  
  <p>Before Putting Validator:</p>
  
  <p><img src="https://i.stack.imgur.com/R8hrC.png" alt="enter image description here"></p>
  
  <pre><code>&lt;asp:Panel ID="pnlSearchComplaint" Visible="false" BackColor="#dbdbdb"
               runat="server" Width="400px"&gt;
              &lt;br /&gt;
              &lt;label&gt;Search By Subject&lt;/label&gt;
              &lt;asp:TextBox ID="txtSearchCompBySubject" runat="server" &gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                  ControlToValidate="txtSearchCompBySubject" ErrorMessage="Enter Subject" 
                                  ForeColor="Red" ValidationGroup="GroupSearchCompSubject"&gt;Enter Subject
              &lt;/asp:RequiredFieldValidator&gt;
              &lt;br/&gt;
              &lt;asp:Button ID="btnSearchBySubject" ValidationGroup="GroupSearchCompSubject"  
                          CssClass="btn btn-success" runat="server" Text="Search" 
                          ClientIDMode="Static" OnClick="btnSearchBySubject_Click" /&gt;
              &lt;asp:GridView ID="gridViewComplaintsBySubject" AllowPaging="true" OnPageIndexChanging="gridViewComplaintsBySubject_PageIndexChanging" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" OnSelectedIndexChanged="gridViewComplaintsBySubject_SelectedIndexChanged" Width="408px"&gt;
               &lt;EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" /&gt;
               &lt;EmptyDataTemplate&gt;
                 No Data Found for this Input. Try Again.
               &lt;/EmptyDataTemplate&gt; 
               &lt;SelectedRowStyle CssClass="selected-row"  ForeColor="white" /&gt;
             &lt;/asp:GridView&gt;
              &lt;br /&gt;
              &lt;label&gt;Search By Date&lt;/label&gt;
              &lt;asp:Label ID="lblDateFrom" runat="server" Text="From"&gt;&lt;/asp:Label&gt;
              &lt;asp:TextBox ID="txtFromDate" runat="server" &gt;&lt;/asp:TextBox&gt;
             &lt;asp:CalendarExtender ID="CalendarExtenderFromDate" TargetControlID="txtFromDate" runat="server"&gt;
              &lt;/asp:CalendarExtender&gt;
              &lt;asp:Label ID="lblDateTo" runat="server" Text="To"&gt;&lt;/asp:Label&gt;
              &lt;asp:TextBox ID="txtToDate" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:CalendarExtender ID="CalendarExtenderToDate" TargetControlID="txtToDate" runat="server"&gt;
              &lt;/asp:CalendarExtender&gt;
              &lt;asp:Button ID="btnSearchByDate"  CssClass="btn btn-success" runat="server" Text="Search" 
                          ClientIDMode="Static" OnClick="btnSearchByDate_Click" /&gt;
              &lt;asp:GridView ID="gridViewComplaintsByDate" AllowPaging="true"  AutoGenerateSelectButton="true" runat="server" CssClass="mGrid"  Width="408px" OnPageIndexChanging="gridViewComplaintsByDate_PageIndexChanging" OnSelectedIndexChanged="gridViewComplaintsByDate_SelectedIndexChanged"&gt;
               &lt;EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" /&gt;
               &lt;EmptyDataTemplate&gt;
                 No Data Found for this Input. Try Again.
               &lt;/EmptyDataTemplate&gt; 
               &lt;SelectedRowStyle CssClass="selected-row"  ForeColor="white" /&gt;
             &lt;/asp:GridView&gt;
             &lt;br /&gt;
      &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>After Putting Validator:</p>
  
  <p><img src="https://i.stack.imgur.com/Z6O8g.png" alt="enter image description here"></p>
  
  <p>Code:</p>
  
  <pre><code>&lt;asp:Panel ID="pnlSearchComplaint" Visible="false" BackColor="#dbdbdb"
               runat="server" Width="400px"&gt;
              &lt;br /&gt;
              &lt;label&gt;Search By Subject&lt;/label&gt;
              &lt;asp:TextBox ID="txtSearchCompBySubject" runat="server" &gt;&lt;/asp:TextBox&gt;
              &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                  ControlToValidate="txtSearchCompBySubject" ErrorMessage="Enter Subject" 
                                  ForeColor="Red" ValidationGroup="GroupSearchCompSubject"&gt;Enter Subject
              &lt;/asp:RequiredFieldValidator&gt;
              &lt;br/&gt;
              &lt;asp:Button ID="btnSearchBySubject" ValidationGroup="GroupSearchCompSubject"  
                          CssClass="btn btn-success" runat="server" Text="Search" 
                          ClientIDMode="Static" OnClick="btnSearchBySubject_Click" /&gt;
              &lt;asp:GridView ID="gridViewComplaintsBySubject" AllowPaging="true" OnPageIndexChanging="gridViewComplaintsBySubject_PageIndexChanging" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" OnSelectedIndexChanged="gridViewComplaintsBySubject_SelectedIndexChanged" Width="408px"&gt;
               &lt;EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" /&gt;
               &lt;EmptyDataTemplate&gt;
                 No Data Found for this Input. Try Again.
               &lt;/EmptyDataTemplate&gt; 
               &lt;SelectedRowStyle CssClass="selected-row"  ForeColor="white" /&gt;
             &lt;/asp:GridView&gt;
              &lt;br /&gt;
              &lt;label&gt;Search By Date&lt;/label&gt;
              &lt;asp:Label ID="lblDateFrom" runat="server" Text="From"&gt;&lt;/asp:Label&gt;
              &lt;asp:TextBox ID="txtFromDate" runat="server" &gt;&lt;/asp:TextBox&gt;
  
               &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                  ControlToValidate="txtFromDate" ErrorMessage="Enter Subject" 
                                  ForeColor="Red" ValidationGroup="GroupSearchCompSubject"&gt;Enter Subject
              &lt;/asp:RequiredFieldValidator&gt;
  
               &lt;asp:CalendarExtender ID="CalendarExtenderFromDate" TargetControlID="txtFromDate" runat="server"&gt;
              &lt;/asp:CalendarExtender&gt;
              &lt;asp:Label ID="lblDateTo" runat="server" Text="To"&gt;&lt;/asp:Label&gt;
              &lt;asp:TextBox ID="txtToDate" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:CalendarExtender ID="CalendarExtenderToDate" TargetControlID="txtToDate" runat="server"&gt;
              &lt;/asp:CalendarExtender&gt;
              &lt;asp:Button ID="btnSearchByDate"  CssClass="btn btn-success" runat="server" Text="Search" 
                          ClientIDMode="Static" OnClick="btnSearchByDate_Click" /&gt;
              &lt;asp:GridView ID="gridViewComplaintsByDate" AllowPaging="true"  AutoGenerateSelectButton="true" runat="server" CssClass="mGrid"  Width="408px" OnPageIndexChanging="gridViewComplaintsByDate_PageIndexChanging" OnSelectedIndexChanged="gridViewComplaintsByDate_SelectedIndexChanged"&gt;
               &lt;EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" /&gt;
               &lt;EmptyDataTemplate&gt;
                 No Data Found for this Input. Try Again.
               &lt;/EmptyDataTemplate&gt; 
               &lt;SelectedRowStyle CssClass="selected-row"  ForeColor="white" /&gt;
             &lt;/asp:GridView&gt;
             &lt;br /&gt;
          &lt;/asp:Panel&gt;
  </code></pre>