Currently in asp.net, we can have only one value in a ListItem in a DropDownList. However I hope I can:
<MultiValueDropDownList id="ddl" runat="server" />
ddl.Items.Add(new MultiValueListItem { Text="text", DBValue="db", EngineValue=1 });
var dbValue = ddl.SelectedItem.DBValue;
What I'm going to do is inherit DropDownList and ListItem. Do you guys have any better solutions?
[Closed]
At last I decide to choose a lazy way. Store the values in ListItem.Attributes
. And using extension methods of DropDownList to help to get the collection of values. Thanks for your help!