Validating a DropDownList in C# Asp.Net
Use RequiredFieldValidator and set the initial value to the default starting item in the list.
<td>
<asp:DropDownList ID=”ctype” runat=”server”>
<asp:ListItem>Select Credit Card Type</asp:ListItem>
<asp:ListItem>Visa</asp:ListItem>
<asp:ListItem>Amex</asp:ListItem>
<asp:ListItem>MasterCard</asp:ListItem>
<asp:ListItem>Discover</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID=”RequiredFieldValidator1″ runat=”server” ErrorMessage=”Please Select Card Type” ControlToValidate=”ctype” InitialValue=”Select Credit Card Type”>
</asp:RequiredFieldValidator>
</td>
