-3

这是我的带有串联列的下拉选择框。如何检索记录的 ID 并将该值传递给 onchange?

<asp:DropDownList 
    ID="DropDownList2" 
    runat="server" 
    DataSourceID="AccessDataSource1" 
    DataTextField="Expr1" 
    DataValueField="Expr1">
</asp:DropDownList>
<asp:AccessDataSource 
    ID="AccessDataSource1" 
    runat="server" 
    DataFile="~/tools/tracker/Tracker.mdb" 
    SelectCommand="SELECT PAcronym + ' - ' + Milestone + ' (' + PRelease + ')' AS Expr1 FROM Projects ORDER BY PAcronym + ' - ' + Milestone + ' (' + PRelease + ')' ">
</asp:AccessDataSource>
4

1 回答 1

2

选择查询中的 ID,然后DataValueField="ID"。然后,您将能够访问 value OnSelectedIndexChanged。它将存储在DropDownList2.SelectedValue.

于 2013-08-02T14:57:28.677 回答