![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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 | http://www.mastergaurav.org http://www.edujini.in | http://webservices.edujini.in ------------------- "Arthur Dent" <hitchhikersguideto-news (AT) yahoo (DOT) com> wrote in message news:%23aKId1JwGHA.4920 (AT) TK2MSFTNGP06 (DOT) 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. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |