【发布时间】:2011-09-20 18:19:18
【问题描述】:
我有一系列由 ASP.NET DropDownLists(由 DataSourceID 的 SqlDataSource 中的选择命令填充)、 元素和 jQueryUI 自动完成插件组成的组合框。不过后两者可以忽略。
每个 DropDownList 控件都代表一个特定的“用户”类别,并根据该类别的 Users 表动态填充。这是数据库结构:
Users (ID, Name) -- I use a join to display the Name, but I wish to USE the ID.
Team (ID, Member1, Member2, Member3) --each member is a foreign key to the
--"Users" table and used to populate the
--DropDownLists respectively.
问题:我需要知道如何在控件中显示Name 字段,但实际上使用所选值的ID 作为我的存储过程的输入。
- 此外,最好使用单个查询和 SqlDataSource 来填充所有下拉列表。目前,我正在为我拥有的 13 个用户类别中的每一个使用单独的“选择”语句。
【问题讨论】:
标签: asp.net foreign-keys sqldatasource web-controls