F
Frédéric Mayot
Hi,
I have a custom composite webcontrol (Frameset) which inherits from the
panel webcontrol. This control uses another control named Menu. If I don't
add mMenu with Controls.Add(mMenu), the menu doesn't render when
mMenu.RenderControl(writer) is invoked. But, if I put Controls.Add(mMenu),
the control is rendered twice (which is normal since I call
MyBase.RenderChildren(writer)).
What should I do ?
Thanks
Fred
<ToolboxData("<{0}:Frameset runat=server></{0}:Frameset>")> _
Public Class Frameset
Inherits System.Web.UI.WebControls.Panel
Implements INamingContainer
Dim mMenu As Menu
Protected Overrides Sub RenderChildren(ByVal writer As
System.Web.UI.HtmlTextWriter)
writer.Write('blabla")
mMenu.RenderControl(writer)
writer.Write("blabla")
MyBase.RenderChildren(writer)
writer.Write("blabla")
End Sub
Protected Overrides Sub CreateChildControls()
MyBase.CreateChildControls()
mMenu = New Menu
Controls.Add(mMenu)
End Sub
I have a custom composite webcontrol (Frameset) which inherits from the
panel webcontrol. This control uses another control named Menu. If I don't
add mMenu with Controls.Add(mMenu), the menu doesn't render when
mMenu.RenderControl(writer) is invoked. But, if I put Controls.Add(mMenu),
the control is rendered twice (which is normal since I call
MyBase.RenderChildren(writer)).
What should I do ?
Thanks
Fred
<ToolboxData("<{0}:Frameset runat=server></{0}:Frameset>")> _
Public Class Frameset
Inherits System.Web.UI.WebControls.Panel
Implements INamingContainer
Dim mMenu As Menu
Protected Overrides Sub RenderChildren(ByVal writer As
System.Web.UI.HtmlTextWriter)
writer.Write('blabla")
mMenu.RenderControl(writer)
writer.Write("blabla")
MyBase.RenderChildren(writer)
writer.Write("blabla")
End Sub
Protected Overrides Sub CreateChildControls()
MyBase.CreateChildControls()
mMenu = New Menu
Controls.Add(mMenu)
End Sub