Dropdown list loses properties on post back
Hi im trying to mimic the itemdata property from vb6 in asp.net.
On post back it seems to lose all attributes?
Initial Load:
? ddlCustomer.items(2).Attributes("ItemData")
"3"
On Post Back:
? ddlCustomer.items(2).Attributes("ItemData")
Nothing
Any way around this? :wave::sick::afrog:
Re: Dropdown list loses properties on post back
How are you populating the DDL? Are you repopulating on each page load?
Re: Dropdown list loses properties on post back
Nope i populate on initial page load and then leave it alone on post backs
Re: Dropdown list loses properties on post back
Did you Code your DropDownlist population inside
vb Code:
If Not (Page.IsPostBack()) Then
'Bind the List Here
End If
Re: Dropdown list loses properties on post back
Its not actually bound. we have a routine that takes the dropdown list
and populates it with data from a collection.
as part of this i set
ddlCustomer.items(2).Attributes("ItemData")
Re: Dropdown list loses properties on post back
Post the other part of code