Can anyone advice how can DropDownList attributes be persisted accross page Postbacks?
DropdownList1.AutoPostBack = True
On Postback the attribute is no longer available (ie. attributes.count=0).
I tried persisting using the code below, but was unsuccessful:
Before PostBack: ViewState.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = ViewState("DDL")
This generated the error: DropDownlist is not marked as serializable.
I than tried:
Before PostBack: Session.Add("DDL","DropdownList1")
On PostBack: DropdownList1 = Session("DDL")
This did not err but attributes were still not available.
View Complete Post