J
Julien
Hi
I'm working on a UserControl which contains all the design html code with placeholders. Then i instanciate the ITemplates in the placeholders.
I have the following code:
<uc1age id="Layout1" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<LeftColumnTemplate>
</LeftColumnTemplate>
<FooterTemplate>
</FooterTemplate>
</uc1age>
When i want to use Labels, or any kind of controls in my subTemplate (HeaderTemplate etc ...) : VS.NET don't parse the children of a subTemplate and in code behind, it doesn't instanciate included controls ! Is VS.NET able to parse childrens in a Itemplate control ?
here is the code behind of my user control :
<ParseChildren(True)> _
Public MustInherit Class PageLayout
Inherits System.Web.UI.UserControl
Public WithEvents HeaderContainer As System.Web.UI.WebControls.PlaceHolder
Public WithEvents ColonneDroiteContainer As System.Web.UI.WebControls.PlaceHolder
Private _bandeauHeaderTemplate As ITemplate = Nothing
Private _headerTemplate As ITemplate = Nothing
Public Property HeaderTemplate() As ITemplate
Get
Return _headerTemplate
End Get
Set(ByVal Value As ITemplate)
_headerTemplate = Value
End Set
End Property
Public Property BandeauHeaderTemplate() As ITemplate
Get
Return _bandeauHeaderTemplate
End Get
Set(ByVal Value As ITemplate)
_bandeauHeaderTemplate = Value
End Set
End Property
Protected Overrides Sub CreateChildControls()
If Not HeaderTemplate Is Nothing Then
HeaderTemplate.InstantiateIn(HeaderContainer)
End If
If Not BandeauHeaderTemplate Is Nothing Then
BandeauHeaderTemplate.InstantiateIn(BandeauHeaderContainer)
End If
End Sub
End Class
thanks.
I'm working on a UserControl which contains all the design html code with placeholders. Then i instanciate the ITemplates in the placeholders.
I have the following code:
<uc1age id="Layout1" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<LeftColumnTemplate>
</LeftColumnTemplate>
<FooterTemplate>
</FooterTemplate>
</uc1age>
When i want to use Labels, or any kind of controls in my subTemplate (HeaderTemplate etc ...) : VS.NET don't parse the children of a subTemplate and in code behind, it doesn't instanciate included controls ! Is VS.NET able to parse childrens in a Itemplate control ?
here is the code behind of my user control :
<ParseChildren(True)> _
Public MustInherit Class PageLayout
Inherits System.Web.UI.UserControl
Public WithEvents HeaderContainer As System.Web.UI.WebControls.PlaceHolder
Public WithEvents ColonneDroiteContainer As System.Web.UI.WebControls.PlaceHolder
Private _bandeauHeaderTemplate As ITemplate = Nothing
Private _headerTemplate As ITemplate = Nothing
Public Property HeaderTemplate() As ITemplate
Get
Return _headerTemplate
End Get
Set(ByVal Value As ITemplate)
_headerTemplate = Value
End Set
End Property
Public Property BandeauHeaderTemplate() As ITemplate
Get
Return _bandeauHeaderTemplate
End Get
Set(ByVal Value As ITemplate)
_bandeauHeaderTemplate = Value
End Set
End Property
Protected Overrides Sub CreateChildControls()
If Not HeaderTemplate Is Nothing Then
HeaderTemplate.InstantiateIn(HeaderContainer)
End If
If Not BandeauHeaderTemplate Is Nothing Then
BandeauHeaderTemplate.InstantiateIn(BandeauHeaderContainer)
End If
End Sub
End Class
thanks.