K
Ken Varn
I have a custom list control that allows other controls to be added to it
dynamically. I want to be able to maintain the custom list of controls on
postback. I tried storing each added control into a ViewState element, but
the WebControl object cannot be stored in ViewState (I get an exception
indicating some controls are not Serializable). This is a bit confusing,
because I can place these same controls in a form and their properties are
preserved (example: ListBox maintains the list of items in the list).
Can someone please indicate how to store the properties of controls that are
encapsulated in a custom control? I would have thought that a control would
expose a GetViewState() method or something like that, but it is protected.
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------
dynamically. I want to be able to maintain the custom list of controls on
postback. I tried storing each added control into a ViewState element, but
the WebControl object cannot be stored in ViewState (I get an exception
indicating some controls are not Serializable). This is a bit confusing,
because I can place these same controls in a form and their properties are
preserved (example: ListBox maintains the list of items in the list).
Can someone please indicate how to store the properties of controls that are
encapsulated in a custom control? I would have thought that a control would
expose a GetViewState() method or something like that, but it is protected.
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------