Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
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

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
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
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!
Sexy Web Design - Free 71 Page Preview!
Everything You Know About CSS Is Wrong! - Free 37 Page Preview!