title: How to use RequiredFieldValidator and ValidationSummary with Bootstrap
body: <p>I am new to ASP.Net and have a simple question about ValidationSummary or Validator in general. The problem is that even if there are no validation errors my alert div is still showing. ASP.Net generates code for clientside validation so how am I going to display the alert div only when an error occurs, is this even possible? I thought that ValidationSummary may help in this situation but I am not sure, hope someone can help me. </p>
  
  <p>Current page:</p>
  
  <pre><code>&lt;asp:Login ID="LoginForm" runat="server" ViewStateMode="Disabled" RenderOuterTable="False" OnAuthenticate="LoginForm_Authenticate"&gt;
      &lt;LayoutTemplate&gt;
              &lt;div class="alert alert-danger" role="alert"&gt;
                  &lt;p&gt;&lt;asp:RequiredFieldValidator ID="RequiredFieldValidatorUserName" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="UserName" Display="Dynamic"&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;asp:RequiredFieldValidator ID="RequiredFieldValidatorPassword" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="Password" Display="Dynamic"&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;asp:TextBox runat="server" CssClass="form-control" ID="UserName" /&gt;
                  &lt;asp:TextBox runat="server" CssClass="form-control" ID="Password" TextMode="Password"/&gt;
              &lt;/div&gt;
              &lt;asp:Button runat="server" ID="Login" CommandName="Login" CssClass="btn btn-default btn-primary" Text="Login" /&gt;
      &lt;/LayoutTemplate&gt;
  &lt;/asp:Login&gt;
  </code></pre>