It is possible using the generics DICTIONARY class:
CODE::
---------------------------------------------------------------------------------
Dictionary
//Setting the dictionary item list
dctLists = new Dictionary
dctLists.Add("hyderabad", 500020);
dctLists.Add("sec-bad", 500009);
dctLists.Add("chikkadpally", 500020);
//Display more than 1 value in the dropdown
ddlMultipleValsDisplaye.DataSource = dctLists;
ddlMultipleValsDisplaye.DataBind();
---------------------------------------------------------------------------------
if you run the above code, then you will see that both the valuees from the dictionary are displayed in the dropdownlist.

No comments:
Post a Comment