Parser Error: Type XYZ does not have a property named 'cc3:MyItems' (complete posting) ASP.NET Web

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

  1. I am having problems trying to get this part of the functionality working on
    my control and I hope somebody has a clue about how to resolve it.

    1. How the relevant tags appear on the ASPX page. The @Register stuff is
    omitted.

    The control is basically a composite who also has a list of items (Items
    property), every item that is defined gets
    a tag of its own within the tag of the control in the ASPX page:

    <cc3:CtPageHeader id="CtPageHeader1" runat="server">
    <cc3:CtPageHeaderItem LinkURL="~/this.aspx"
    Text="This"></cc3:CtPageHeaderItem>
    <cc3:CtPageHeaderItem LinkURL="~/that.aspx"
    Text="That"></cc3:CtPageHeaderItem>
    </cc3:CtPageHeader>

    So far so good. I can drop the control on the design surface, I can select
    the Items property which in turn pops up a window to enter the items
    (collection editor). As a result the items get inserted in the form as shown
    above. The items are within the control's tag (InnerDefaultProperty).

    2. This is how the control class has been declared. Notice that it has a
    collection to hold the items and a property to access this collection. So
    far so good AFAIK.
    [DesignerAttribute(typeof(CtPageHeaderDesigner), typeof(IDesigner)),
    DefaultProperty("Items"),
    ToolboxData("<{0}:CtPageHeader runat=server></{0}:CtPageHeader>")]
    public class DocHeader : System.Web.UI.WebControls.WebControl,
    INamingContainer
    {
    // This member contains all the items defined for the control,
    private CtPageHeaderLinkItemCollection items = new
    CtPageHeaderLinkItemCollection();

    [Category("Misc"),
    Bindable(true),
    NotifyParentProperty(true),
    PersistenceMode(PersistenceMode.InnerDefaultProperty),
    Description("The collection of Links and SubLinks")]
    public CtPageHeaderLinkItemCollection Items
    {
    get { return this.items; }
    set { this.items = value; }
    }
    :
    }

    3. The items that can be added as well as edited with the collection editor
    are handled by a class that was declared as shown below (irrelevant code
    omitted). For the sake of clarity in this message I am omitting the property
    and using public members instead.

    public class CtPageHeaderLinkItem : System.Web.UI.Control
    {
    public string LinkURL;
    public string Text;
    :
    }

    Up to here ok. The whole things builds OK. It functions perfectly AS LONG AS
    I DO NOT DEFINE ANY ITEMS. As soon as I define items (like the two shown in
    point #1) I get the following message on the Designer window for this
    particular control:

    Error Creating Control - CtPageHeader1
    Parser Error: Type 'CtPageHeader does not have a property named
    'cc3:CtPageHeaderLinkItem'

    When I run the demo page the same error is displayed (obviously) by means of
    an exception...

    I tried by changing the name of the tags in #1 to "Items" (cc3:Items) in
    hopes that it would go away considering there was now a property with the
    same name as the inner tags which corresponded to the collection. The
    problem still persists,

    So, how can I "link" these two things so that these inner properties get
    properly mapped (by the parser) to the Items property which is of type
    CtPageHeaderLinkItem? I am obviously missing some finer point,

    Thanks,
    Emilio
     
    ~~~ .NET Ed ~~~, Nov 10, 2004
    #1
    1. Advertising

  2. No answer yet ? I have searched all over but can't get this error to go away

    "~~~ .NET Ed ~~~" <> wrote in message
    news:...
    > I am having problems trying to get this part of the functionality working

    on
    > my control and I hope somebody has a clue about how to resolve it.
    >
    > 1. How the relevant tags appear on the ASPX page. The @Register stuff is
    > omitted.
    >
    > The control is basically a composite who also has a list of items (Items
    > property), every item that is defined gets
    > a tag of its own within the tag of the control in the ASPX page:
    >
    > <cc3:CtPageHeader id="CtPageHeader1" runat="server">
    > <cc3:CtPageHeaderItem LinkURL="~/this.aspx"
    > Text="This"></cc3:CtPageHeaderItem>
    > <cc3:CtPageHeaderItem LinkURL="~/that.aspx"
    > Text="That"></cc3:CtPageHeaderItem>
    > </cc3:CtPageHeader>
    >
    > So far so good. I can drop the control on the design surface, I can select
    > the Items property which in turn pops up a window to enter the items
    > (collection editor). As a result the items get inserted in the form as

    shown
    > above. The items are within the control's tag (InnerDefaultProperty).
    >
    > 2. This is how the control class has been declared. Notice that it has a
    > collection to hold the items and a property to access this collection. So
    > far so good AFAIK.
    > [DesignerAttribute(typeof(CtPageHeaderDesigner), typeof(IDesigner)),
    > DefaultProperty("Items"),
    > ToolboxData("<{0}:CtPageHeader runat=server></{0}:CtPageHeader>")]
    > public class DocHeader : System.Web.UI.WebControls.WebControl,
    > INamingContainer
    > {
    > // This member contains all the items defined for the control,
    > private CtPageHeaderLinkItemCollection items = new
    > CtPageHeaderLinkItemCollection();
    >
    > [Category("Misc"),
    > Bindable(true),
    > NotifyParentProperty(true),
    > PersistenceMode(PersistenceMode.InnerDefaultProperty),
    > Description("The collection of Links and SubLinks")]
    > public CtPageHeaderLinkItemCollection Items
    > {
    > get { return this.items; }
    > set { this.items = value; }
    > }
    > :
    > }
    >
    > 3. The items that can be added as well as edited with the collection

    editor
    > are handled by a class that was declared as shown below (irrelevant code
    > omitted). For the sake of clarity in this message I am omitting the

    property
    > and using public members instead.
    >
    > public class CtPageHeaderLinkItem : System.Web.UI.Control
    > {
    > public string LinkURL;
    > public string Text;
    > :
    > }
    >
    > Up to here ok. The whole things builds OK. It functions perfectly AS LONG

    AS
    > I DO NOT DEFINE ANY ITEMS. As soon as I define items (like the two shown

    in
    > point #1) I get the following message on the Designer window for this
    > particular control:
    >
    > Error Creating Control - CtPageHeader1
    > Parser Error: Type 'CtPageHeader does not have a property named
    > 'cc3:CtPageHeaderLinkItem'
    >
    > When I run the demo page the same error is displayed (obviously) by means

    of
    > an exception...
    >
    > I tried by changing the name of the tags in #1 to "Items" (cc3:Items) in
    > hopes that it would go away considering there was now a property with the
    > same name as the inner tags which corresponded to the collection. The
    > problem still persists,
    >
    > So, how can I "link" these two things so that these inner properties get
    > properly mapped (by the parser) to the Items property which is of type
    > CtPageHeaderLinkItem? I am obviously missing some finer point,
    >
    > Thanks,
    > Emilio
    >
    >
     
    ~~~ .NET Ed ~~~, Nov 13, 2004
    #2
    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. ~~~ .NET Ed ~~~
    Replies:
    0
    Views:
    951
    ~~~ .NET Ed ~~~
    Nov 10, 2004
  2. Christof Krueger
    Replies:
    1
    Views:
    613
    Christof Krueger
    Dec 19, 2003
  3. Bob
    Replies:
    1
    Views:
    1,301
    Mark Fitzpatrick
    Feb 8, 2008
  4. ~~~ .NET Ed ~~~
    Replies:
    0
    Views:
    208
    ~~~ .NET Ed ~~~
    Nov 10, 2004
  5. juglesh
    Replies:
    5
    Views:
    223
    Thomas 'PointedEars' Lahn
    May 15, 2005
Loading...

Share This Page