I have a UserControl called UC_Widget, it inheriting from System.Web.UI.UserControl and ITextControl and it also overide the function AddParsedSubObject.when i used it like below,it runs well.
<uc1:UC_Widget ID="UC_Widget1" runat="server">
hello world
</uc1:UC_Widget>
but,it come out a problem: if i want to use this control to contain another user control, how can i do for this?? many thx!
<uc1:UC_Widget ID="UC_Widget1" runat="server">
hello world
<uc1:UC_Widget ID="UC_Widget2" runat="server">
guy
</uc1:UC_Widget>
</uc1:UC_Widget>
thx Nix,i have solved the problem by the AddParsedSubObject method.
protected override void AddParsedSubObject(object obj)
{
if (this.HasControls())
{
base.AddParsedSubObject(obj);
}
else if (obj is LiteralControl)
{
HtmlContent.Append(((LiteralControl)obj).Text);
this.Text = HtmlContent.ToString();
}
else
{
string text1 = this.Text;
UC_eClinicWidget tmp = obj as UC_eClinicWidget;
if (tmp != null)
{
HtmlContent.Append(GetControlHtml(tmp));
this.Text = HtmlContent.ToString();
}
}
}