Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DropDownList get underlying object

I have an DropDownList bound to an ObjectDataSource. when I select a row in the drop down how do I get the underlying object(not just the value or text properties). I'm trying to add the selected object from the DropDownList to a Listbox's datasource but I don't know how to reference the object picked. The objects aren't backed in a database so they don't really have keys per say. Maybe there's a better way to do this.

like image 748
Michael Avatar asked Jun 23 '09 14:06

Michael


1 Answers

If you are trying to get the actual object (like a list item or data row), you can't after the postback (actually, I don't think you can before the postback either). The values are saved in the selected item property, but the bound object is discarded.

like image 105
kemiller2002 Avatar answered Nov 03 '22 13:11

kemiller2002