title: how to detect the textBox element which is not validated and add some css style to that textbox afterwards using asp validation controls?
body: <p>I am using asp validation controls to validate a form with some <code>&lt;asp:textbox&gt;</code>s in my page.Giving an error message for a not-validated textBox is pretty easy using the error message attribute in the <code>&lt;asp:validation&gt;</code> controls.The thing I want to do is that I want my textBoxes to become red when they are not validated.To achieve this goal (I'm guessing that) I need to detect the not-validated textbox and give it a special style using css.But I have no idea how!</p>
  
  <p>for example look at this code:</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
      &lt;div&gt;
          username: &lt;br /&gt;
          &lt;asp:TextBox ID="txtboxUserName" runat="server"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:RequiredFieldValidator ID="UserNameReq" ControlToValidate="txtboxUserName" ErrorMessage="username is required!!!" SetFocusOnError="true" runat="server"&gt;
          &lt;/asp:RequiredFieldValidator&gt;&lt;br /&gt;
          password: &lt;br /&gt;
          &lt;asp:TextBox ID="txtboxPassword" TextMode="Password" runat="server"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:RequiredFieldValidator ID="PasswordReq" ControlToValidate="txtboxPassword" ErrorMessage="password is required!!!!" SetFocusOnError="true" runat="server"&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;br /&gt;
          &lt;asp:Button ID="submitButton" Text="submit" runat="server" /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want the username and password textboxes to become red themselves when the user doesn't type anything in them!(To be clear,I want to do this on other types of validations too,and the code above is just an example)</p>