HighTechTalks DotNet Forums  

Inherited DropDownList and asp:listitems

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Inherited DropDownList and asp:listitems in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Arthur Dent
 
Posts: n/a

Default Inherited DropDownList and asp:listitems - 08-15-2006 , 03:02 PM






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.



Reply With Quote
  #2  
Old   
Gaurav Vaish \(www.EduJini.IN\)
 
Posts: n/a

Default Re: Inherited DropDownList and asp:listitems - 08-15-2006 , 09:54 PM






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

Quote:
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.




Reply With Quote
  #3  
Old   
Arthur Dent
 
Posts: n/a

Default Re: Inherited DropDownList and asp:listitems - 08-16-2006 , 11:07 AM



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


"Gaurav Vaish (www.EduJini.IN)" <gaurav.vaish.nospam (AT) nospam (DOT) gmail.com> wrote
in message news:uDF10bNwGHA.4416 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
Quote:
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.






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.