Validation With Drop Down List
How can i use validation with Drop down List?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Oct 25, 2012, 2:20 AM
Suppose in your application you are using a DropDownList in a Form and depending upon the item selection you are showing/hiding some views inside a Multiview and you want that the user must select one of the item from the DropDownList before submitting a Form.
So How to handle this problem. The solution is very simple, you have to do the following things -
Make CausesValidation="false" for the DropDown.
Remove any validation group for that DropDown, i.e ValidationGroup="none"
Handle client side change event to avoid Blocking of Submit on DropDown item change, i.e onchange="Page_BlockSubmit = false;"
Please refer the below link
http://www.mindfiresolutions.com/DropDownList-Validation-problem-in-ASPNET-736.php
Thanks
If this post helps you mark it as answer
Swati AgarwalPosted Oct 26, 2012, 2:31 AM
Swati AgarwalPosted Oct 26, 2012, 2:30 AM
Sachin KaliaPosted Oct 25, 2012, 2:16 AM
These are few links which would help you out to enable validation on dropdownlist using server side as well as client side.
http://asp-net-example.blogspot.in/2008/10/dropdownlist-example-how-to-validate.html
http://www.mindfiresolutions.com/DropDownList-Validation-problem-in-ASPNET-736.php
http://www.codeproject.com/Tips/404274/Client-Side-Validation-using-JavaScript
Happy Coding !
Dorababu MekaPosted Oct 25, 2012, 2:16 AM
Santhosh Kumar JayaramanPosted Oct 25, 2012, 2:15 AM
Mostly you need to to validation in Dropdownlist_Selectionchangedevent