Inherited DropDownList and asp:listitems

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

  1. #1

    Default Inherited DropDownList and asp:listitems

    Hi all,

    I have a control which i wrote which inherits the asp:dropdownlist control.
    Works great, all happy.
    If when using it i try to declaratively add some items, it complains that
    they are unknown types. eg...

    <mytag:mydropdownlist id="lstInherited" runat="server"
    appenddatabounditems="true" >
    <asp:listitem id="" value="select an item" >
    </mytag:mydropdownlist>

    It complains that asp:listitem is an unknown element. How can i direct the
    runtime that my dropdownlist
    control can contain asp:listitems like its base class? I assume some sort of
    attribute on the class, but i am
    looking for any direction as to what attribute.
    Thanks in advance,
    - Arthur Dent.


    Arthur Dent Guest

  2. Similar Questions and Discussions

    1. Exposing ListItems in Composite Control
      I'm trying to build a composite control that consists of a select inside a div (a listbox inside a panel). My problem is that when I compile the...
    2. #25908 [Bgs]: Inherited class properties aren't inherited until after class is parsed [?]
      ID: 25908 Updated by: helly@php.net Reported By: kyle at putnamcabinets dot com Status: Bogus Bug Type: ...
    3. #25908 [Opn->Bgs]: Inherited class properties aren't inherited until after class is parsed [?]
      ID: 25908 Updated by: helly@php.net Reported By: kyle at putnamcabinets dot com -Status: Open +Status: ...
    4. #25908 [Opn]: Inherited class properties aren't inherited until after class is parsed [?]
      ID: 25908 User updated by: kyle at putnamcabinets dot com -Summary: Class properties are added automatically (at compile...
    5. Inherited DropDownList Designer problem
      I have an inherited DropDownList custom control that in the DataBind() method I add a bunch pre determined list items that contain the various...
  3. #2

    Default Re: Inherited DropDownList and asp:listitems

    Look into the following attribtue:
    ParseChildrenAttribute (System.Web.UI)
    PersistChildrenAttribute (System.Web.UI)

    The child controls, by default, are not accepted.
    You may also need to override AddedParsedSubObject method for type-safety of
    the controls added.

    --
    Happy Hacking,
    Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    -------------------


    "Arthur Dent" <hitchhikersguideto-news@yahoo.com> wrote in message
    news:%23aKId1JwGHA.4920@TK2MSFTNGP06.phx.gbl...
    > Hi all,
    >
    > I have a control which i wrote which inherits the asp:dropdownlist
    > control. Works great, all happy.
    > If when using it i try to declaratively add some items, it complains that
    > they are unknown types. eg...
    >
    > <mytag:mydropdownlist id="lstInherited" runat="server"
    > appenddatabounditems="true" >
    > <asp:listitem id="" value="select an item" >
    > </mytag:mydropdownlist>
    >
    > It complains that asp:listitem is an unknown element. How can i direct the
    > runtime that my dropdownlist
    > control can contain asp:listitems like its base class? I assume some sort
    > of attribute on the class, but i am
    > looking for any direction as to what attribute.
    > Thanks in advance,
    > - Arthur Dent.
    >

    Gaurav Vaish \(www.EduJini.IN\) Guest

  4. #3

    Default Re: Inherited DropDownList and asp:listitems

    Thanks for the tips....
    I will check out those attribs/methods.
    Cheers!


    "Gaurav Vaish (www.EduJini.IN)" <gaurav.vaish.nospam@nospam.gmail.com> wrote
    in message news:uDF10bNwGHA.4416@TK2MSFTNGP03.phx.gbl...
    > Look into the following attribtue:
    > ParseChildrenAttribute (System.Web.UI)
    > PersistChildrenAttribute (System.Web.UI)
    >
    > The child controls, by default, are not accepted.
    > You may also need to override AddedParsedSubObject method for type-safety
    > of the controls added.
    >
    > --
    > Happy Hacking,
    > Gaurav Vaish | [url]http://www.mastergaurav.org[/url]
    > [url]http://www.edujini.in[/url] | [url]http://webservices.edujini.in[/url]
    > -------------------
    >
    >
    > "Arthur Dent" <hitchhikersguideto-news@yahoo.com> wrote in message
    > news:%23aKId1JwGHA.4920@TK2MSFTNGP06.phx.gbl...
    >> Hi all,
    >>
    >> I have a control which i wrote which inherits the asp:dropdownlist
    >> control. Works great, all happy.
    >> If when using it i try to declaratively add some items, it complains that
    >> they are unknown types. eg...
    >>
    >> <mytag:mydropdownlist id="lstInherited" runat="server"
    >> appenddatabounditems="true" >
    >> <asp:listitem id="" value="select an item" >
    >> </mytag:mydropdownlist>
    >>
    >> It complains that asp:listitem is an unknown element. How can i direct
    >> the runtime that my dropdownlist
    >> control can contain asp:listitems like its base class? I assume some sort
    >> of attribute on the class, but i am
    >> looking for any direction as to what attribute.
    >> Thanks in advance,
    >> - Arthur Dent.
    >>
    >
    >

    Arthur Dent 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