Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi frnds,

i want to default city="pune" in dropdown when click on button(New).
when change country then automatically change city according to that country..that coding done but i want to set by default country(india) and city(pune) in dropdown on click button(New)..
so how can i do??
plz help me.....
thanks in advance...
Posted

Hi ,
Check this
c# combobox selectedindexchanged events[^]

how to get bind all the values in drop down depending upon the other drop down[^]

Google[^]

Quote:
default country(india) and city(pune)

C#
DropDownList1.SelectedValue = "20";

set SelectedValue with The value of it in DataBase
Best Regards
M.Mitwalli
 
Share this answer
 
Comments
__TR__ 19-Nov-12 12:42pm    
5!
Try following code after Binding your Dropdown.

C#
ddlCountry.SelectedItem.Text.Trim()="India";
ddlCity.SelectedItem.Text.Trim()="Pune";


Note : You can also try the SelectedValue property of Dropdown

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900