The drop down control in .aspx page
DataBinding in .aspx.cs
Dictionary
cityDataList.Add("DEL", "Delhi");
cityDataList.Add("BOM", "Mumbai");
cityDataList.Add("MAA", "Chennai");
cityDataList.Add("GOI", "Goa");
// Binding dictionary data with DropDownList
foreach (string key in cityDataList.Keys)
{
CityList.Items.Add(new ListItem(cityDataList[key], key));
}
1 comment:
Seems intersting but I am looking for a more elegant solution.
Post a Comment