how to validate Dropdownlist in ASP.NET
-
hi to all i have a dropdownlist on page try to validate through RequiredfieldValidater BUT it is not working. i think the possible error in Initial value property of required field validator.. plz. help me how to implement validation on dropdownlist and sent some sample code if possble thanks john
-
hi to all i have a dropdownlist on page try to validate through RequiredfieldValidater BUT it is not working. i think the possible error in Initial value property of required field validator.. plz. help me how to implement validation on dropdownlist and sent some sample code if possble thanks john
can you specify what exactly you want to validate..?
pradip kishore
-
hi to all i have a dropdownlist on page try to validate through RequiredfieldValidater BUT it is not working. i think the possible error in Initial value property of required field validator.. plz. help me how to implement validation on dropdownlist and sent some sample code if possble thanks john
-
hi to all i have a dropdownlist on page try to validate through RequiredfieldValidater BUT it is not working. i think the possible error in Initial value property of required field validator.. plz. help me how to implement validation on dropdownlist and sent some sample code if possble thanks john
Hi! What I did in my project is that, I inserted a new Listitem at index 0 of my dropdownlist with, say, value of "-1". then I added a CompareValidator control with properties: Type="String"; ControlToValidate="MyDropdownList"; ValueToCompare="-1" Operator="NotEqual"; coded like -> Note that the ValueToCompare's value is the same as the ListItem value I added to my dropdownlist, and the Operator is "NotEqual". hope it helps.. //mastereuo On Error Goto Hell
-
Hi! What I did in my project is that, I inserted a new Listitem at index 0 of my dropdownlist with, say, value of "-1". then I added a CompareValidator control with properties: Type="String"; ControlToValidate="MyDropdownList"; ValueToCompare="-1" Operator="NotEqual"; coded like -> Note that the ValueToCompare's value is the same as the ListItem value I added to my dropdownlist, and the Operator is "NotEqual". hope it helps.. //mastereuo On Error Goto Hell
-
How is this any different to using a requiredFieldValidator and setting the InitialValue to -1 (in your example)
-
hi to all i have a dropdownlist on page try to validate through RequiredfieldValidater BUT it is not working. i think the possible error in Initial value property of required field validator.. plz. help me how to implement validation on dropdownlist and sent some sample code if possble thanks john
This my solution, you must to create a dropdownlist with only one item, the text is '-' y el value is the same... So, insert a COMPAREVALIDATOR and make this changes ControltoValidate: the dropdownlist Operator: Not Equal ValuetoCompare: - (Its the line) Thats all, the validator fireup if you choose the line value Best regards :rose:
keep Learning and you never will be out of date...