Converting a Dropdownlist Items into a Dictionary Object

vishalneeraj-24503
Posted by vishalneeraj-24503 under LINQ category on | Points: 40 | Views : 497
var ddl_result = ddl_project.Items.Cast<ListItem>()

.ToDictionary(item => item.Value,

item => item.Text,StringComparer.OrdinalIgnoreCase);

Above code will convert Dropdown list items into Dictionary.

Comments or Responses

Login to post response