S
Shaneo
I've been searching for a while and have found jack on composite
controls... Most source say it is as easy as this .. what is wrong
with the following code...
I'm trying to change a property of the label, works in design... but
as soon as I build all is lost...
I've tried everything ... what am I missing...
Simple Code snipet below...
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace ctrlTest
{
public class etest1:WebControl,INamingContainer
{
private Label _lab=new Label();
[
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
NotifyParentProperty(true)
]
public Label Heading{
get{
//if(_lab==null)_lab=new Label();
return _lab;
}
}
protected override void RenderContents(HtmlTextWriter writer)
{
Heading.RenderControl(writer);
base.RenderContents (writer);
}
}
}
Here is the HTML Side...
<cc3:etest1 id="Etest13" style="Z-INDEX: 101; LEFT: 290px; POSITION:
absolute; TOP: 213px" runat="server"
Width="526px" Height="248px"></cc3:etest1>
Please please help, Thanks in advance
controls... Most source say it is as easy as this .. what is wrong
with the following code...
I'm trying to change a property of the label, works in design... but
as soon as I build all is lost...
I've tried everything ... what am I missing...
Simple Code snipet below...
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace ctrlTest
{
public class etest1:WebControl,INamingContainer
{
private Label _lab=new Label();
[
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
NotifyParentProperty(true)
]
public Label Heading{
get{
//if(_lab==null)_lab=new Label();
return _lab;
}
}
protected override void RenderContents(HtmlTextWriter writer)
{
Heading.RenderControl(writer);
base.RenderContents (writer);
}
}
}
Here is the HTML Side...
<cc3:etest1 id="Etest13" style="Z-INDEX: 101; LEFT: 290px; POSITION:
absolute; TOP: 213px" runat="server"
Width="526px" Height="248px"></cc3:etest1>
Please please help, Thanks in advance