title: how to remove line breaks in a div when required field validtor visiblity =false (asp.net)
body: <p>hi im have a very common problem but unable to find any answer
  i have a div and there are validator controls in it. I have used br tag in ErrorMessage Text to show show each message in new line. My code is below
     
      </p>
  
  <pre><code>    &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="lblMessageError"
          runat="server"  ErrorMessage="&lt;br&gt; User name field cannot be empty" ControlToValidate="txtUserName" SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt; 
      &lt;asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ClientValidate" ControlToValidate="txtPassword" CssClass="lblMessageError" ErrorMessage="&lt;br /&gt;The password must be more than 6 characters."&gt;&lt;/asp:CustomValidator&gt;  
      &lt;asp:CompareValidator ID="CompareValidator1" runat="server" CssClass="lblMessageError" ControlToCompare="txtPassword" controlToValidate="txtRePassword" ErrorMessage="&lt;br /&gt; Password dont match with repassword"&gt;&lt;/asp:CompareValidator&gt;  
  &lt;/div&gt;
  </code></pre>
  
  <p>when there is no error found then it show line breaks. all i want is when there is not error found line breaks are ommitted.</p>
  
  <p>1) when all validators are hidden</p>
  
  
  
  <p>'&lt;%--line Break because no error found--%> <br>
    '&lt;%--line Break because no error found--%> <br> 
    ' &lt;%--line Breakbecause no error found---%><br> </p>
  
  
  
  <p>2) when one validator is visible and other and hidden</p>
  
  
  
  <p>User name field cannot be empty<br>
    ' &lt;%--line Break because no error found--%> <br>
    ' &lt;%--line Breakbecause no error found---%><br> 
  '&lt;%-- ally my controls here--%></p>
  
  <p>and i also dont want to show all my errors in same line
  any suggestions??</p>