Quick question. Its easy enough to bind a value and text to a drop down in markup, how can I do this in C#.
To bind a single column collection
_dd_City.DataSource = LNQ.tbl_cities.Select(a => a.desc);
_dd_City.DataBind();
however say I wanted to set the value to an integer value and the text to the city name, how could I do that ??
You just need to specify the name of the properties from the objects in your collection that will be used for the text and value like this:
You can set the text and value field on your markup too.