Home / file parsed but not updating / Validating dropdown list selection in asp c sharp

Validating dropdown list selection in asp c sharp

If you attempt to submit the form in Listing 3.1 without entering a value for a field, then a validation error message is displayed (see Figure 3.1). Notice that there is nothing wrong with associating more than one validation control with a form field.If you need to make a form field required and check the data type entered into the form field, then you need to associate both a when, and only when, there are no validation errors on the page.Supported browsers include Internet Explorer, Firefox, and Opera. NET, which supported only Internet Explorer as an uplevel browser.You can use the validation controls with browsers that do not support Java Script (or do not have Java Script enabled).This one will allow me to select from a droplist (assuming the devs have done their job as expected and put IDs on both the droplist and the elements within the droplist): First you have to locate the web-element uniquely presented as select list on UI, you can use Firebug for that to find list element's id, name, xpath or css path.

You can use the validation controls to prevent users from submitting the wrong type of data into a database table.

Next, we extend the basic validation controls with our own custom validation controls.

For example, you learn how to create an control is associated with each of the three form fields.

Bypassing validation is useful when creating a Cancel button.

I'm using the Selenium IDE to record my initial tests and then export them to c# and then use the webdriver. I am trying to select a State from a drop-down text list.


  1. The DevExpress List Box ASPxListBox editor allows you to select multiple list items at the same time. The editor's SelectionMode property controls.

Leave a Reply

Your email address will not be published. Required fields are marked *