hello all i have two drop down list in form and binding it on form load event

problem is when i run the application it shows the first value in dropdownlists index no 0
insted of that i want to show blank on run and on click of dropdown it shows values means i want 0 index of drop down list Blank

there is in windows aaplication funda like ddl.selectedindex=-1 works but in case of web application it does not work

please help faster
and thanks in advance

Recommended Answers

All 3 Replies

Hey dude- bind your dropdown as normal way. then just add below line and it will work for you.

drp_Country.Items.Insert(0, new ListItem("Please Select Country", "-1"));

try by this and let us know..

hello all i have two drop down list in form and binding it on form load event

problem is when i run the application it shows the first value in dropdownlists index no 0
insted of that i want to show blank on run and on click of dropdown it shows values means i want 0 index of drop down list Blank

there is in windows aaplication funda like ddl.selectedindex=-1 works but in case of web application it does not work

please help faster
and thanks in advance

thank you rohand its working thaks alot for fast reply

Thanks alot for ur answer... It was working for my code also...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.