title: ASP.NET Validation styling
body: <p>I'm using ASP.NET WebForms and using some validation like the following:</p>
  
  <pre><code>&lt;asp:TextBox  runat="server" ID="txtUserName" CssClass="Email" /&gt;&lt;br /&gt;
  &lt;asp:RequiredFieldValidator runat="server" ID="rfvUserName" Display="Dynamic" ControlToValidate="txtUserName" ErrorMessage="Please enter your email address" CssClass="Error" /&gt;
  &lt;asp:RegularExpressionValidator Enabled="false" runat="server" ID="revUserName" Display="Dynamic" ControlToValidate="txtUserName" ErrorMessage="Please enter a valid email address" ValidationExpression="&lt;%$ Resources:Global, RegExEmail %&gt;" /&gt;
  </code></pre>
  
  <p>What I want to do is instead of just showing a message below in the form of a span I would like to alter the textbox itself, such as add a red border around it and change its background to have an error icon. How do I do this? Thanks.</p>