How do I get the value of the DataValueField of my drop down listbox ?
I have a drop down listbox and it is associated with the data source: SELECT [ParameterName], [ColumnName] FROM [tableSearchParameters]
In my code behind I can get the value that was selected in the drop down listbox control. But how do I get the value of the DataValueField?
I tried line 3 below but it just returned the words "DataValueField"
1 DropDownList ParameterName = (DropDownList)sender;
2 String theChoice = ParameterName.SelectedItem.ToString();
3 String theVoice=ParameterName.DataValueField.ToString();
Here is the definition of my DropDown list in the aspx code:
<asp:DropDownList ID="ddlParameterName" runat="server" AppendDataBoundItems="True"
& ...
Go to the complete details ...