重新访问DropdownList数据源 [英] Retriving DropdownList datasource

查看:89
本文介绍了重新访问DropdownList数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有Customer类,其中包含以下属性:



客户

- CustomerID

- 客户名称

- CustomerLastName


我有一个客户到下拉列表的绑定列表,其中DataTextField为CustomerName,DataValueField为CustomerID。



现在当我我从下拉列表中选择客户我希望CustomerLastName用于其他一些操作。

那么如何使用ASP.Net和C访问CustomerLastName?#b $ b



谢谢,

Parimal

Hi,
I have Customer class with the following properties:

Customer
- CustomerID
- CustomerName
- CustomerLastName

I have bind list of customer to dropdownlist with DataTextField as CustomerName, and DataValueField as CustomerID.

Now when I am selecting customer from dropdown i want CustomerLastName for some other operation.
So how can access CustomerLastName using ASP.Net and C#


Thanks,
Parimal

推荐答案

当CustomerID是唯一的时,您可以通过CustomerID获取CustomerLastName。

您最终如何做到这一点取决于您如何存储数据,您能否提供有关您正在使用的数据库系统的详细信息?或者您使用文件来存储客户?
When the CustomerID is unique you can get the CustomerLastName by the CustomerID.
How you do that in the end depends on how you store the data, can you give me details about the database system you are using? Or are you using a file to store the customers?


这篇关于重新访问DropdownList数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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