all groups > asp.net webcontrols > april 2004 >
You're in the

asp.net webcontrols

group:

CollectionBase


CollectionBase Victor Irzak
4/28/2004 8:55:17 PM
asp.net webcontrols:
Hello group,

I have a class that inherits from CollectionBase.

I have a public property of that class and I want it to be serialized using
[PersistenceMode(PersistenceMode.InnerProperty)].



For some reason it doesn't show up in HTML.

The same class without CollectionBase Serializes perfectly.



How can I overcome this problem?



TIA Victor

Re: CollectionBase David Jessee
4/29/2004 7:41:27 AM
I'm not sure why it would show up in HTML. The only reason you's serialize
an object is so that its state can be de-serialized at a later dtime (after
post-back, for instance). What is the type of this private member that
isn't serializing? Is it serializable? Have you marked your derived Class
as [Serializable()] ?


[quoted text, click to view]

Re: CollectionBase David Jessee
4/29/2004 7:45:52 AM
that was a stupid response...sorry.


[quoted text, click to view]

Re: CollectionBase Victor Irzak
4/29/2004 11:35:18 AM
The problem is that the class that derives from CollectionBase will only
serialize in HTML if it has items in its list.
It will NOT serialize any aditional attributes.
What I want to do is to serialize the properties, but not the items.

Victor


[quoted text, click to view]

Re: CollectionBase Fred Hirschfeld
4/29/2004 6:14:47 PM
So are you trying to use a collection as an attribute of a Custom Control
and have the public properties of the Collection class be serialized into
the HTML? Could you give one property example code for this and the expected
HTML results you want?

Fred

[quoted text, click to view]

AddThis Social Bookmark Button