ViewState of the Composite Control composed of custom control

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: whoisnidhee (whoisnidhee_at_yahoo.com)
Date: 07/14/04


Date: 14 Jul 2004 06:33:21 -0700

I have a web server control that renders itself as a Rectangle with
some other properties like ID etc. I have another Composite Control
that contains an ArrayList. This ArrayList contains a collection of
Rectangles with different IDs. The Composite Control implements the
IPostBackEventHandler interface and contains an HTML Button control
that generates a Postback.
The problem is that I am unable to save the ViewState of the Composite
Control. The error I get is "The type 'Controls.Rectangle' must be
marked as Serializable or have a TypeConverter other than
ReferenceConverter to be put in viewstate. "
Marking the control as Serializable also resulted in the same error.


Quantcast