Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Error: Webcontrol must have items of type X. SubLinks is of type Y

Reply
Thread Tools

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

 
 
~~~ .NET Ed ~~~
Guest
Posts: n/a
 
      11-07-2004
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?



 
Reply With Quote
 
 
 
 
~~~ .NET Ed ~~~
Guest
Posts: n/a
 
      11-08-2004
Nobody has any pointers regarding this problem?

"~~~ .NET Ed ~~~" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>
>



 
Reply With Quote
 
 
 
 
~~~ .NET Ed ~~~
Guest
Posts: n/a
 
      11-10-2004
Nobody knows this one? I haven't figured it out yet.

"~~~ .NET Ed ~~~" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom webcontrol that references another webcontrol Fabricio ASP .Net Building Controls 0 09-21-2005 02:55 AM
Trapping an Exception ocurring in a Webcontrol at the Page or parent WebControl level. ASP .Net 2 01-31-2005 06:34 PM
WebControl inside of WebControl and attaching events Kasabaarde Sumta ASP .Net Building Controls 0 12-13-2004 09:51 PM
WebControl with non-WebControl property Peter Morris [Air Software Ltd] ASP .Net Web Controls 1 12-07-2004 12:25 PM
Can a webcontrol (webcontrol.dll) have a configuration file? Luis Ramírez. ASP .Net Building Controls 2 07-06-2004 04:35 PM



Advertisments