开发者

Assign some data fields to DropDownList item

开发者 https://www.devze.com 2023-04-10 06:12 出处:网络
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).

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号