AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 validation of dropdown
Posted by sreedhar MA on  2/14/2011 9:25:37 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
i have a form which contains three dropdown list. . i want to implement validation for all three. can someone help me out to solve this??

Post Your Reply Post New Question

 Viewer's Reply
Validation of Dropdown Control in Asp.Net
Answered By Moderator1 on 2/15/2011 8:15:00 AM
Hi,

You have to explain, on what type of validation you need for your dropdown control. If the drop downs are Mandatory controls, then you can simply use Required Field Validator control. Otherwise, you can go for Custom Validators.
 
Validation of dropdown
Answered By prashant on 2/16/2011 2:28:10 AM
Hi
You use required filled validator in that set InitialValue to your select option value
for ex :
<asp:dropdownlist runat='server' id='dd1'>
<ListItem value='0'>Select</ListItem >
<ListItem value='1'>hi</ListItem ></asp:dropdownlist>

<asp:RequiredFieldValidator ID="rfvformname" runat="server" ErrorMessage="Please select "
Display="None" ControlToValidate="dd1" InitialValue="0"></asp:RequiredFieldValidator>
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Programmers Heaven C# School Book - Free 338 Page eBook
Simply SQL - Free 111 Page Preview!
Website Magazine