Error: Webcontrol must have items of type X. SubLinks is of type Y

Discussion in 'ASP .Net Building Controls' started by ~~~ .NET Ed ~~~, Nov 7, 2004.

  1. Hi,
    I have made a web control that has two sorts of items. The first is the
    Links property that has a persistence attribute of InnerProperty, the other
    is SubLinks with the same attribute. Both are of the same collection type.
    The control has its own designer class (although it doesn't render in Design
    mode like the others I have done, it
    still beats me).

    The container web control would be in the aspx page as follows (simplified
    way)

    <cc1:CtPageHeader .....>
    <SubLinks>
    <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx" Text="Demo" ...
    ></cc1:CtPageHeaderLinkItem>

    </SubLinks>
    <Links>
    <cc1:CtPageHeaderLinkItem LinkURL="url" Text="text"></cc1:MyControlItem>
    </Links>
    </cc1:CtPageHeader >

    When I try to run it I get the following error:

    Line 37: <cc1:CtPageHeader id="CtPageHeader1" style="Z-INDEX: 103; LEFT:
    24px; POSITION: absolute; TOP: 24px"
    Line 38: runat="server" Width="472px"
    ConfigPath="e:\WebSites\Config\CtPageHeader.config" EnableViewState="False">
    Line 39: <SubLinks>
    Line 40: <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx"
    LinkItemType="SectionLink" Text="Products"
    ID="ctPageHeaderLinkItem1"></cc1:CtPageHeaderLinkItem>
    Line 41: <cc1:CtPageHeaderLinkItem LinkURL="about.aspx" Text="About Us"
    ID="ctPageHeaderLinkItem2"></cc1:CtPageHeaderLinkItem>


    For debugging I tried adding an Add(HtmlGenericControl) overload to the
    custom item collection in hopes of catching it (breakpoint) and then reading
    the LinkURL & Text attributes of the generic control, but that did not work
    as it didn't get there. Where should I be looking? where can I set a
    breakpoint for this?
     
    ~~~ .NET Ed ~~~, Nov 7, 2004
    #1
    1. Advertising

  2. Nobody has any pointers regarding this problem?

    "~~~ .NET Ed ~~~" <> wrote in message
    news:...
    > Hi,
    > I have made a web control that has two sorts of items. The first is the
    > Links property that has a persistence attribute of InnerProperty, the

    other
    > is SubLinks with the same attribute. Both are of the same collection type.
    > The control has its own designer class (although it doesn't render in

    Design
    > mode like the others I have done, it
    > still beats me).
    >
    > The container web control would be in the aspx page as follows (simplified
    > way)
    >
    > <cc1:CtPageHeader .....>
    > <SubLinks>
    > <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx" Text="Demo" ...
    > ></cc1:CtPageHeaderLinkItem>

    > </SubLinks>
    > <Links>
    > <cc1:CtPageHeaderLinkItem LinkURL="url"

    Text="text"></cc1:MyControlItem>
    > </Links>
    > </cc1:CtPageHeader >
    >
    > When I try to run it I get the following error:
    >
    > Line 37: <cc1:CtPageHeader id="CtPageHeader1" style="Z-INDEX: 103; LEFT:
    > 24px; POSITION: absolute; TOP: 24px"
    > Line 38: runat="server" Width="472px"
    > ConfigPath="e:\WebSites\Config\CtPageHeader.config"

    EnableViewState="False">
    > Line 39: <SubLinks>
    > Line 40: <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx"
    > LinkItemType="SectionLink" Text="Products"
    > ID="ctPageHeaderLinkItem1"></cc1:CtPageHeaderLinkItem>
    > Line 41: <cc1:CtPageHeaderLinkItem LinkURL="about.aspx" Text="About Us"
    > ID="ctPageHeaderLinkItem2"></cc1:CtPageHeaderLinkItem>
    >
    >
    > For debugging I tried adding an Add(HtmlGenericControl) overload to the
    > custom item collection in hopes of catching it (breakpoint) and then

    reading
    > the LinkURL & Text attributes of the generic control, but that did not

    work
    > as it didn't get there. Where should I be looking? where can I set a
    > breakpoint for this?
    >
    >
    >
     
    ~~~ .NET Ed ~~~, Nov 8, 2004
    #2
    1. Advertising

  3. Nobody knows this one? I haven't figured it out yet.

    "~~~ .NET Ed ~~~" <> wrote in message
    news:...
    > Hi,
    > I have made a web control that has two sorts of items. The first is the
    > Links property that has a persistence attribute of InnerProperty, the

    other
    > is SubLinks with the same attribute. Both are of the same collection type.
    > The control has its own designer class (although it doesn't render in

    Design
    > mode like the others I have done, it
    > still beats me).
    >
    > The container web control would be in the aspx page as follows (simplified
    > way)
    >
    > <cc1:CtPageHeader .....>
    > <SubLinks>
    > <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx" Text="Demo" ...
    > ></cc1:CtPageHeaderLinkItem>

    > </SubLinks>
    > <Links>
    > <cc1:CtPageHeaderLinkItem LinkURL="url"

    Text="text"></cc1:MyControlItem>
    > </Links>
    > </cc1:CtPageHeader >
    >
    > When I try to run it I get the following error:
    >
    > Line 37: <cc1:CtPageHeader id="CtPageHeader1" style="Z-INDEX: 103; LEFT:
    > 24px; POSITION: absolute; TOP: 24px"
    > Line 38: runat="server" Width="472px"
    > ConfigPath="e:\WebSites\Config\CtPageHeader.config"

    EnableViewState="False">
    > Line 39: <SubLinks>
    > Line 40: <cc1:CtPageHeaderLinkItem LinkURL="demo.aspx"
    > LinkItemType="SectionLink" Text="Products"
    > ID="ctPageHeaderLinkItem1"></cc1:CtPageHeaderLinkItem>
    > Line 41: <cc1:CtPageHeaderLinkItem LinkURL="about.aspx" Text="About Us"
    > ID="ctPageHeaderLinkItem2"></cc1:CtPageHeaderLinkItem>
    >
    >
    > For debugging I tried adding an Add(HtmlGenericControl) overload to the
    > custom item collection in hopes of catching it (breakpoint) and then

    reading
    > the LinkURL & Text attributes of the generic control, but that did not

    work
    > as it didn't get there. Where should I be looking? where can I set a
    > breakpoint for this?
    >
    >
    >
     
    ~~~ .NET Ed ~~~, Nov 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    742
  2. NeoGeoSNK
    Replies:
    25
    Views:
    947
    NeoGeoSNK
    Nov 24, 2006
  3. PB
    Replies:
    10
    Views:
    6,663
    Dave Thompson
    Mar 27, 2006
  4. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    208
    Luis Ramírez
    Jul 6, 2004
  5. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    203
    Kasabaarde Sumta
    Dec 13, 2004
Loading...

Share This Page