Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Victor Irzak #1
Serialiazing CollectionBase
Hello...
I the following class deriving from CollectionBase:
============================
public class YYYepC : System.Collections.CollectionBase
{
int i = 9;
[DefaultValue(4)]
[PersistenceMode(PersistenceMode.Attribute)]
public int I
{
get {return i;}
set {i=value;
}
}
}
============================
When I try to serialize it in my web control, the "I" property doesn't get
serialized. Only the sollection items get serialized.
Here is my control:
============================
public class WebChartingControl : System.Web.UI.WebControls.WebControl
{
YYYepC da2 = new YYYepC();
[PersistenceMode(PersistenceMode.InnerProperty)]
[NotifyParentProperty(true)]
public YYYepC YYYepC
{
get {return da2;}
set {da2 = value;}
}
}
============================
How can I serialize all the other properties?
Thanks,
Victor
Victor Irzak Guest
-
Inheriting from the CollectionBase causes weird Error: System.IO.FileNotFoundException
I am having a problem exposing a class inherited from the collection base class as a webservice. If I expose the collection on a web page all works... -
Binding custom objects to datagrid WITHOUT using Collectionbase
Hi I'm having difficulty bind a collection of custom objects to a datagrid. For reasons that I'll explain shortly I can't use Collectionbase, so... -
Fred Hirschfeld #2
Re: Serialiazing CollectionBase
I don't think I can answer your question but might be able to point you in
the right direction... Collections are intended to be serialized as items to
the Control when used this way. I use them to serialize inner tags to be
used by the control like the DataGrid uses Columns.
I think you are going to need to create a custom designer to process the
collection class so it does the properties of the collection instead of the
items of the collection. Take a look into DesignerSerializerAttribute class
to see if there are examples for it out there...
Fred
"Victor Irzak" <virzak@rogers.com> wrote in message
news:eQdp6AhLEHA.3712@TK2MSFTNGP10.phx.gbl...> Hello...
> I the following class deriving from CollectionBase:
>
> ============================
> public class YYYepC : System.Collections.CollectionBase
> {
> int i = 9;
>
> [DefaultValue(4)]
> [PersistenceMode(PersistenceMode.Attribute)]
> public int I
> {
> get {return i;}
> set {i=value;
> }
> }
> }
> ============================
>
> When I try to serialize it in my web control, the "I" property doesn't get
> serialized. Only the sollection items get serialized.
>
> Here is my control:
> ============================
> public class WebChartingControl : System.Web.UI.WebControls.WebControl
> {
>
> YYYepC da2 = new YYYepC();
>
> [PersistenceMode(PersistenceMode.InnerProperty)]
> [NotifyParentProperty(true)]
> public YYYepC YYYepC
> {
> get {return da2;}
> set {da2 = value;}
> }
> }
> ============================
>
>
> How can I serialize all the other properties?
>
> Thanks,
>
> Victor
>
>
Fred Hirschfeld Guest



Reply With Quote

