To make the composite control can be viewed at design time, we need to do the following
For the composite control, put the Designer attributes, specify the designer class
****Code start******
<Designer(GetType(CompositeControlDesigner))>
Public class CompositeControl
...
****Code End******
And for the CompositeControlDesigner Class,
****Code start******
public class CompositeControlDesinger
Inherits System.Web.UI.Design.ControlDesigner
Public overrides Function GetDesignTimeHtml() as String
Dim Control As CompositeLogin = Ctype(Component, CompositeLogin)
Dim childControls As ControlCollection = Control.Controls
Return MyBase.GetDesignTimeHtml
End Function
End Class
****Code End*****
My Problem is for
Dim Control As CompositeLogin = Ctype(Component, CompositeLogin)
Dim childControls As ControlCollection = Control.Controls
seems like it has no use as finally the function just return MyBase.GetDesignTimeHtml,
but it is needed to show the controls. How the mechanism going behind?