DropDownList gets the base object

I have a DropDownList associated with an ObjectDataSource. when I select a line from the drop-down list how to get the base object (and not just the values โ€‹โ€‹or properties of the text). I am trying to add a selected object from DropDownList to a Listbox data source, but I do not know how to reference the selected object. Objects are not supported in the database, so they donโ€™t actually have keys. Maybe there is a better way to do this.

+6
data-binding
source share
1 answer

If you are trying to get the actual object (for example, a list item or a data string), you wonโ€™t be able to after the postback (in fact, I donโ€™t think you can do this before the postback). Values โ€‹โ€‹are stored in the property of the selected item, but the associated object is discarded.

+8
source share

All Articles