在asp.net中的下拉列表 [英] drop down list in asp.net

查看:80
本文介绍了在asp.net中的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



一个具有2个数据值字段的下拉列表是否可能? 在我的应用而选择对应2点的数据值需要访问...............

解决方案
一个特定的数据文本字段
http://www.pcreview.co.uk/forums/dropdownlist-multiple- data-values-t2616009.html [ ^ ]

请检查此链接


下拉列表中不能有2个数据值.如果要有2个值,则需要用一些特殊字符连接起来,例如〜

对于Exmaple:您的数据源值应该像这样

DataValue DataText
1〜1测试1
1〜2测试2
1〜3测试3

访问值时,可以使用拆分功能并获取2个值.

String [] strValue = drpDown.SelectedItem.Value.split(〜");


希望有帮助!

Senthil S


最好的方法是在存储过程中合并数据值并使用它.


hi,

is it possible for a dropdownlist having 2 data value field,,,,,,,
in my application while selecting a particular data text field corresponding 2 data values need to be accessed...............

解决方案

Hi,
http://www.pcreview.co.uk/forums/dropdownlist-multiple-data-values-t2616009.html[^]

please check this link


You cant have 2 datavalue in dropdown. If you want have 2 values you need to Concatenate with some special chacter like ~

For Exmaple: Your Datasource values should be like this

DataValue DataText
1~1 Test1
1~2 Test2
1~3 Test3

While Accessing the value you can use split function and get 2 values.

String[] strValue=drpDown.SelectedItem.Value.split("~");


Hope this help!

Senthil S


Best way is to concat the data values in stored procedure and use it .


这篇关于在asp.net中的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆