Click here to Skip to main content
14,699,491 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please this is my first question here...I have a program/Library written with jquery that populates All the countries in the world, my problem is to store the selected country to my database.... Please, the countries get populated without the use of <asp:listitem> that is used with the dropdown.. Please suggest to me what to do..

What I have tried:

I have tried

Country.selected item.value
Country. Selected item.text

For each(Listbox item in Country.item)
Posted
Updated 6-Sep-20 22:52pm
v2
Comments
Sandeep Mewara 23-Aug-20 3:27am
   
What do you mean by listbox used with dropdown? Better to share the implementation you have done.

Try:
string theSelectedItemText = MyDropDownList.SelectedItem.Text;
Probably that means
string theSelectedItemText = Country.SelectedItem.Text;
in your case but it's not that obvious from your "code" samples.
   
Thanks bro.... I finally did it this way

1. Got the SQL dump of all the countries, ran the queryand cities...and then bind it to my dropdown.... Thanks
   

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