I'm using ASP.NET WebForms and using some validation like the following:
<asp:TextBox runat="server" ID="txtUserName" CssClass="Email" /><br />
<asp:RequiredFieldValidator runat="server" ID="rfvUserName" Display="Dynamic" ControlToValidate="txtUserName" ErrorMessage="Please enter your email address" CssClass="Error" />
<asp:RegularExpressionValidator Enabled="false" runat="server" ID="revUserName" Display="Dynamic" ControlToValidate="txtUserName" ErrorMessage="Please enter a valid email address" ValidationExpression="<%$ Resources:Global, RegExEmail %>" />
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.