Validation for DropDownList

Sandeepraturi
Posted by Sandeepraturi under ASP.NET category on | Points: 40 | Views : 1536
<div>

<asp:DropDownList ID="dl" runat="server">
<asp:ListItem Value="0">Select One Name</asp:ListItem>
<asp:ListItem>Sandeep</asp:ListItem>
<asp:ListItem>Pradeep</asp:ListItem>
<asp:ListItem>Dinesh</asp:ListItem>

</asp:DropDownList>
<asp:RequiredFieldValidator ID="rf" runat="server" ErrorMessage="Select One Name" ControlToValidate="dl" InitialValue="0"></asp:RequiredFieldValidator>
</div>
<div><asp:Button ID="btn" runat="server" Text="submit" /></div>

Comments or Responses

Posted by: Sandeepraturi on: 2/6/2014 Level:Starter | Status: [Member] | Points: 10
Thanks Palpatel090

Login to post response