I'm using the following Compare Validator :
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="DropDownList1" ErrorMessage="None can't be selected!"
Operator="NotEqual" ValueToCompare="None"></asp:CompareValidator>
over the following Dropdown List:
<asp:DropDownList ID="DropDownList1" runat="server" Height="17px" Width="181px">
<asp:ListItem>None</asp:ListItem>
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
<asp:ListItem>Three</asp:ListItem>
</asp:DropDownList>
Here's what happens : Initially, nothing happens, and 'None' is selected by default. If I choose any other option and THEN choose 'None', it give me the error.
What I want to do is have the validator display the error right away when the page is first loaded, and not wait for the user to change to some other option and back over to 'None' or wait for the user to submit the form before displaying the form again.
How can I achieve this?