Validate DropDownList Asp.net

http://msmvps.com/blogs/simpleman/archive/2005/07/18/57948.aspx
<form id="Form1" method="post" runat="server">

< FONT>   <asp:DropDownList id="DropDownList1" runat="server">
       <asp:ListItem Value="-1">--> Choose  <--<!--asp:ListItem>
       <asp:ListItem Value="1">Lebanon<!--asp:ListItem>
       <asp:ListItem Value="2">Kuwait<!--asp:ListItem>
   </<!--asp:DropDownList>
   <asp:RequiredFieldValidator id="RequiredFieldValidator1" 
       runat="server" ErrorMessage="You must select a valid option"
       ControlToValidate="DropDownList1" InitialValue="-1" 
       Display="Dynamic" />
<!--<P>
    <asp:Button id="Button1" runat="server" Text="Post Back" />
<<!--<!--P>
<!--<form>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s