Assign some data fields to DropDownList item
I want to assign 2 data fields to a DropDownList item because I want to display 2 values at click at an item in different elements (for example, 2 tex开发者_如何学Ctboxes).
For example: at click on a DDL item, that a value of data field named "example" displayed in one TXTBOX and other of a data field named "definition" displayed in other TXTBOX.
If you have do something like this, you can just separate the two values with some sort of delimiter (, or | or whatever), and then parse them out when it's selected and you have to display them.
Item.Value = "VALUE1,VALUE2";
string[] Values = Item.Value.Split(',');
txt1.Text = Values[0];
txt2.Text = Values[1];
精彩评论