storing objects in ViewState

Discussion in 'ASP .Net Building Controls' started by D Wicker, Oct 28, 2003.

  1. D Wicker

    D Wicker Guest

    Hello,
    I'm developing a web custom control and am trying to store an instance of a
    class
    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:
    [Serializable]
    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
    missing?

    Any suggestions?
    Thanks for any replies.
    Donnie
    D Wicker, Oct 28, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Munsifali Rashid
    Replies:
    0
    Views:
    440
    Munsifali Rashid
    Jun 27, 2003
  2. Teemu Keiski
    Replies:
    3
    Views:
    2,078
    Jacob Yang [MSFT]
    Aug 18, 2003
  3. toton
    Replies:
    11
    Views:
    704
    toton
    Oct 13, 2006
  4. Jonathan Wood
    Replies:
    1
    Views:
    507
    Jonathan Wood
    Jun 2, 2008
  5. D Wicker

    storing objects in ViewState

    D Wicker, Oct 28, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    166
    D Wicker
    Oct 28, 2003
Loading...

Share This Page