Professional Web Applications Themes

Error: Webcontrol must have items of type X. SubLinks is of type Y - ASP.NET Building Controls

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 ...

  1. #1

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

    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 ~~~ Guest

  2. #2

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

    Nobody has any pointers regarding this problem?

    "~~~ .NET Ed ~~~" <tiredofspamabolishspam.now> wrote in message
    news:OKodvUOxEHA.484TK2MSFTNGP09.phx.gbl...
    > 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 ~~~ Guest

  3. #3

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

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

    "~~~ .NET Ed ~~~" <tiredofspamabolishspam.now> wrote in message
    news:OKodvUOxEHA.484TK2MSFTNGP09.phx.gbl...
    > 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 ~~~ Guest

Similar Threads

  1. Replies: 4
    Last Post: February 22nd, 06:11 AM
  2. Problem with character palette and Tracking field: can't type zero after type is modified
    By Tim_Murray@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 0
    Last Post: May 11th, 04:21 PM
  3. Cast from type 'Field' to type 'String'
    By in forum ASP Database
    Replies: 2
    Last Post: November 11th, 03:18 PM
  4. cast from datetime type to smalldatetime type?
    By Salim Afar in forum ASP.NET General
    Replies: 2
    Last Post: August 1st, 03:29 PM
  5. Cast from type 'DBNull' to type 'String' is not valid error
    By Rob in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: July 28th, 09:11 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