0
我有一個從SQL數據庫中讀取的下拉列表。取決於所選的選項,我想從DataValueField中提取實際的值。我怎麼做?如何從DataValueField中提取值?
Page_Load(object sender, EventArgs e)
{
...
ddlOption.DataTextField = "Option";
ddlOptions.DataValueField = "OptCode";
...
}
protected void ddlOptionSelectionChange(object sender, EventArgs e)
{
...
string menuOption = "";//NEED ACTUAL VALUE BASED ON OPTION SELECTED IN OPTCODE
...
}