Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > storing objects in ViewState

Thread Tools

storing objects in ViewState

D Wicker
Posts: n/a
I'm developing a web custom control and am trying to store an instance of a
in the ViewState and keep getting an exception:

"The type 'MyClass' must be marked as Serializable or have a TypeConverter
other than ReferenceConverter to be put in veiwstate."

I've marked the class with [Serializable] like below:
public class MyClass

But I still get the same exception.

I'm trying to store this instance of 'MyClass' in the ViewState in the
CreateChildControls() method. Also MyClass has members of other classes
that I have also marked each one of those Serializable also. I'm pretty new
to building custom web controls so maybe there's something obvious that I'm

Any suggestions?
Thanks for any replies.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
User Images: Storing in Files VS Storing in Database Jonathan Wood ASP .Net 1 06-02-2008 05:56 PM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
storing pointer vs storing object toton C++ 11 10-13-2006 11:08 AM
storing objects in ViewState D Wicker ASP .Net Building Controls 0 10-28-2003 05:41 PM
Re: Storing page information / viewstate between pages Munsifali Rashid ASP .Net 0 06-27-2003 03:51 PM