Professional Web Applications Themes

ITeamplate : parsing children ? - ASP.NET Building Controls

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: <uc1:page id="Layout1" runat="server"> <HeaderTemplate> </HeaderTemplate> <LeftColumnTemplate> </LeftColumnTemplate> <FooterTemplate> </FooterTemplate> </uc1:page> When i want to use Labels, or any kind of controls in my subTemplate (HeaderTemplate etc ...) : VS.NET don't p the children of a subTemplate and in code behind, it doesn't instanciate included controls ! Is VS.NET able to p childrens in a Itemplate control ? here is the code behind of my user control : <PChildren(True)> _ Public MustInherit Class ...

  1. #1

    Default ITeamplate : parsing children ?

    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:

    <uc1:page id="Layout1" runat="server">
    <HeaderTemplate>

    </HeaderTemplate>
    <LeftColumnTemplate>

    </LeftColumnTemplate>
    <FooterTemplate>
    </FooterTemplate>
    </uc1:page>

    When i want to use Labels, or any kind of controls in my subTemplate (HeaderTemplate etc ...) : VS.NET don't p the children of a subTemplate and in code behind, it doesn't instanciate included controls ! Is VS.NET able to p childrens in a Itemplate control ?

    here is the code behind of my user control :
    <PChildren(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(BandeauHeaderC ontainer)
    End If
    End Sub

    End Class

    thanks.
    Julien Guest

  2. #2

    Default Re: ITeamplate : parsing children ?

    "Julien" <Juliendiscussions.microsoft.com> wrote in message
    news:16A0BC39-E952-4A78-A9DE-4C754461BD1Bmicrosoft.com...
    > Hi
    >
    > I'm working on a UserControl which contains all the design html code with
    placeholders. Then i instanciate the ITemplates in the placeholders.

    You can't do anything that complicated with a user control. You need to
    create a custom control.
    --
    John Saunders
    johnwsaundersiii at hotmail


    John Saunders Guest

Similar Threads

  1. pulling in children of children in XML
    By flipflop9 in forum Macromedia Flash Data Integration
    Replies: 4
    Last Post: September 27th, 10:11 AM
  2. parsing many children in control
    By Mariusz in forum ASP.NET Building Controls
    Replies: 0
    Last Post: December 22nd, 01:05 PM
  3. Ignore literal content when parsing custom control children?
    By Donal McWeeney in forum ASP.NET Building Controls
    Replies: 2
    Last Post: September 6th, 08:10 AM
  4. Parsing Children and embeded custom controls
    By gozza in forum ASP.NET Building Controls
    Replies: 3
    Last Post: January 27th, 11:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139