I am quite new to programming and will really appreciate if anyone can help me..Thanks
Question: My dropdown list in my web project is holding value of a person name in ‘DataTextField’ and it is holding person’s ID in the ‘DataValueField’
so if I want to print the value of the DataValueField what shall I do?
What I did:
Dim PersonID as String = DropDownPerson.DataValueField
Response.Write(PersonID)
but the above code is returning the column name and not the value of the column.
Please help !
Just to clear something up –
DataTextFieldandDataValueFieldare used by the dropdown control (and databinding) to describe which fields to use as the display value and identity value for a selected row.SelectedValueholds the actual value of the field named inDataValueFieldfor the selected row.