Validating dropdownlist in 2 0

Rated 3.97/5 based on 953 customer reviews

Can a requiredfieldvalidator be used for a dropdown list, and how would you use it? I see someone else joined my question and he got his answers, my question in still there. I have a drop down list which is not visible at first. Add(new List Item("Miss Player", "MP")); ddl_season. Net Developer Vadodara - Gujarat Please remember to click “Mark as Answer” on the post that helps you. Add(new List Item("--Select one--", "")); ddl_season.

I have a requiredfieldvalidator for my dropdownlist. User choses some options(somewhere else) and according to that I fill the dropdown list and make it visible. Add(new List Item("John Player", "JP")); ddl_season. This can be beneficial to other community members reading the thread.

Hi @logaretm , sorry i was new to fiddle and I pasted the link which had the initial version which I was working on.

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 .

In Asp.net, sometimes we need to validate List Box and Drop Down List using Required field validator.

It is tricky and avoids the use of Java Script function to validate List Box and Drop Down List. For validating Drop Down List, make sure you have "--Select--" option value 0 other wise validation on it will not work.

Even when I add items to my dropdownlist, the requiredfieldvalidator doesn't seem to acknowledge it. Now I want to use a required field validator on the dropdown list to make sure that the dropdownlist is not empty. Add(new List Item("--Select one--", "")); ddl_season.

[1] first make sure that you have set the dropdownlist property Append Data Bound Items = true; [2] in page_load() insert an item at 0 index in dropdownlist as.. if i have country database it has two fields 1) Countryid 2) countryname country id is identity it will increment one by one , suppose Initiall i had 10 items ( or country name) afterwar i have deleted the 4 record ( it may be in the middle , first or top , even, one after another) after delete the record the country id with name would be deleted how can i make it as order for the country id like 1,2,3,4, etc.. if i have country database it has two fields 1) Countryid 2) countryname country id is identity it will increment one by one , suppose Initiall i had 10 items ( or country name) afterwar i have deleted the 4 record ( it may be in the middle , first or top , even, one after another) after delete the record the country id with name would be deleted how can i make it as order for the country id like 1,2,3,4, etc.. Add(new List Item("Wills Classic", "WC")); Ashvin Padhiyar Asp. Add(new List Item("MP", "Miss Player")); ddl_season.

Leave a Reply