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

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

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

    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.InnerDefaultProper ty),
    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 ~~~ Guest

  2. Similar Questions and Discussions

    1. String Array Property produces Parser Error
      Dear readers, I'm having problems with creating a custom control that accepts an array of strings as a property. First I used the following code...
    2. Error while using 'ControlState' property in my custom control
      My name is Pavan and I am a software engineer working on ASP .Net web development. Currently I am using .Net 2.0 Professional Edition to...
    3. Error Creating Control: Parser Error DocHeader does not have a property named 'cc3:MyItems'
      I am having problems getting this webcontrol working properly. Everything else works fine except having items. So here is the low-down on the...
    4. Parser Error Message: Could not load type - Please HELP
      I have aspx file VS.NET 2002 with c# My application works perfectly on my pc. Please, I need help... THANKS :) ============================= 1) I...
    5. Error Setting user control property at web form
      Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I...
  3. #2

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

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

    "~~~ .NET Ed ~~~" <tiredofspam@abolishspam.now> wrote in message
    news:OoTXh20xEHA.2016@TK2MSFTNGP15.phx.gbl...
    > 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.InnerDefaultProper ty),
    > 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 ~~~ Guest

Posting Permissions

  • You may not post new threads
  • You may 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