Validating drop down list in asp c sharp

in this example code dropdownlist initial value is 'Choose One', because we set this text for the dropdownlist control's first item Text property value.

I have a drop down list on a page, by default the option that is displayed is 'Please Select One'.

when users submit a form without changing selection of a dropdownlist items, then the first item is post to server as selected item if there is no initial selected item.

normally web developers put an instruction only item at dropdownlist items top such as an item with text 'select an item' etc.

In this scenario if you add a Required Field Validator, the validator can not validate the Drop Down List.

In this article I will explain how to create dynamic Drop Down List control in

At the moment users can select that option and gain access to the next page, what I want to do is if 'Please Select One' is selected ensure that access to the next page/step will not be given until an actual option on the drop down list is selected.

Im guessing some sort of If statement but im unsure of how to do this. This is my code for my ddl If you are adding code to your questions, please take a minute to format it, you have a preview of what it looks like just under the question text.

Please post your feedback, question, or comments about this article. NET is the superb platform for dump high-end applications, and there are a runs like the wind code of ways to what end programmers can use. This passage discusses seven lucky books that finance developers to raw material various features of .

Drop Down List is an list web server control that allow us to select a single item from a drop-down-list at a time. the following c# example code demonstrate us how can we validate a dropdownlist control in a web form.