L
LucaP
Hi. I'm developing a WebControl that uses the following custom attributes:
[ParseChildren(false), PersistChildren(false)]
I'm using ParseChildren(false), because i've got two collection properties
that use the following custom attributes:
[NotifyParentProperty(true),
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
The ASPX code produced by VS.NET is something like:
<cc:myControl>
<collection1>
<cc:innerControl id="innerControl11"/>
<cc:innerControl id="innerControl12"/>
</collection1>
<collection2>
<cc:innerControl id="innerControl21"/>
<cc:innerControl id="innerControl22"/>
</collection1>
</cc:myControl>
The problem is that i need the persistence of another property that isn't a
collection.
The property is a class derived from Control:
private SimpleControlClass simpleControl;
public SimpleControlClass SimpleControl
{
get
{
if (simpleControl == null)
simpleControl = new SimpleControlClass();
return simpleControl;
}
}
How can i have the persistence of this property?
I need an ASPX code like:
<cc:myControl>
<cc:SimpleControlClass Property1="SampleProperty"/>
<collection1>
<cc:innerControl id="innerControl11"/>
<cc:innerControl id="innerControl12"/>
</collection1>
<collection2>
<cc:innerControl id="innerControl21"/>
<cc:innerControl id="innerControl22"/>
</collection1>
</cc:myControl>
Could you help me, please?
Thanx a lot.
[ParseChildren(false), PersistChildren(false)]
I'm using ParseChildren(false), because i've got two collection properties
that use the following custom attributes:
[NotifyParentProperty(true),
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
The ASPX code produced by VS.NET is something like:
<cc:myControl>
<collection1>
<cc:innerControl id="innerControl11"/>
<cc:innerControl id="innerControl12"/>
</collection1>
<collection2>
<cc:innerControl id="innerControl21"/>
<cc:innerControl id="innerControl22"/>
</collection1>
</cc:myControl>
The problem is that i need the persistence of another property that isn't a
collection.
The property is a class derived from Control:
private SimpleControlClass simpleControl;
public SimpleControlClass SimpleControl
{
get
{
if (simpleControl == null)
simpleControl = new SimpleControlClass();
return simpleControl;
}
}
How can i have the persistence of this property?
I need an ASPX code like:
<cc:myControl>
<cc:SimpleControlClass Property1="SampleProperty"/>
<collection1>
<cc:innerControl id="innerControl11"/>
<cc:innerControl id="innerControl12"/>
</collection1>
<collection2>
<cc:innerControl id="innerControl21"/>
<cc:innerControl id="innerControl22"/>
</collection1>
</cc:myControl>
Could you help me, please?
Thanx a lot.