I have a dropdownlist with a datatext field name country and a datavaluefield named countryid.
I need to get the开发者_JAVA百科 datavaluefield's value and store it in an sql table "mytable", based on the selectedindexchanged event of the dropdownlist.
Please keep the code in C#.
Use the following:
requestedValue = dropDownList.SelectedValue;
string value = ddl.SelectedItem.Text;
*This will return the selected item's text in value, which you can use in your db statements *
精彩评论