我有以下标记:
<td>
<asp:DropDownList runat="server" ID="ddlExtRouteBusyID" style="width: 320px;" />
</td>
其背后的代码在页面加载时执行:
//Bind the route busy drop down list:
DataTable dr = /*[some DataTable returned from a wrapper to an RDBMS*/;
this.ddlExtRouteBusyID.DataSource = dt;
this.ddlExtRouteBusyID.DataTextField = "description";
this.ddlExtRouteBusyID.DataValueField = "id";
this.ddlExtRouteBusyID.DataBind();
我似乎无法根据 SelectedItem/Value 的值访问描述和 ID 数据。例如,如果我选择第二个列表项,SelectedIndex 为 1,但描述可能是“server2”,ID 可能是 1118。如何提取描述和 ID 值?
谢谢。