troubleshooting Question

Validate that the default item is not selected in a DropDownList

Avatar of VGMForbin
VGMForbin asked on
ASP.NET
5 Comments1 Solution256 ViewsLast Modified:
I have a DropDownList that has the first item being "(Choose One)".  I want to set up a validator to make sure that the user cannot contine with that item selected.   I set up a RequiredFieldValidator with "(Choose One)" set as the InitialValue property, and that did not work.  I also set up a CompareValidator to test that the value wasn't equal to "(Choose One)", but that also failed.  Am I doing something incorrect?
<asp:CompareValidator
                    ID="SelecterCompareValidator"
                    runat="server"
                    ErrorMessage="Please choose an item." 
                    ControlToValidate="SelecterDownList" Display="Static" Operator="NotEqual" 
                    ValueToCompare="(Choose One)" />
ASKER CERTIFIED SOLUTION
karakav

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros