ITemplate and designer code generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wojski696969
    New Member
    • Sep 2008
    • 3

    #1

    ITemplate and designer code generation

    Hi, i've made my own Custom Server Control, wich inherits from WebControl class.

    Inside of my control I've create three ITemplate properties wich should be used as containers for Head, Content and Footer.

    Here is example of my Content property

    Code:
    1        <Browsable(False), Description("The template property"), PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(ContentPanel))> _
    2        Public Property Content() As ITemplate
    3            Get
    4                Return _content
    5            End Get
    6            Set(ByVal value As ITemplate)
    7                _content = value
    8            End Set
    9        End Property

    ContentPanel is another control wich inherits from Panel control.

    Now I've got fallowing asp.net code:



    Code:
    1    <controls:MyControl id="MyControl1" runat="server">
    2                <Content>
    3                    <asp:Label ID="someLabel" runat="server" Text="dupa" />
    4                </Content>
    5    </controls:LayoutFrameControl>
    The problem is, that someLabel is not added to .design.vb file after it's generated, why? Is there any solution? any attribute or sth? Please help me, because i've lost many hours to find the solution..
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Are you adding the controls while debugging the application?

    In this case, the control will be added to the page but since it's in debugging mode the designer.vb file cannot be updated.

    -Frinny

    Comment

    Working...