Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Inherited DropDownList and asp:listitems

Reply
Thread Tools

Inherited DropDownList and asp:listitems

 
 
Arthur Dent
Guest
Posts: n/a
 
      08-15-2006
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
 
 
 
 
Gaurav Vaish \(www.EduJini.IN\)
Guest
Posts: n/a
 
      08-16-2006
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
 
 
 
 
Arthur Dent
Guest
Posts: n/a
 
      08-16-2006
Thanks for the tips....
I will check out those attribs/methods.
Cheers!


"Gaurav Vaish (www.EduJini.IN)" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Class.inherited' v. 'inherited' syntax inside Class 7stud -- Ruby 11 11-09-2007 06:45 PM
Inherited DropDownList and asp:listitems Arthur Dent ASP .Net Building Controls 1 08-16-2006 03:07 PM
Can not call codebehind function for inherited dropdownlist Joe ASP .Net Web Controls 0 11-17-2003 11:56 PM
Inherited DropDownList Designer Problem Ron Vecchi ASP .Net Web Controls 0 09-14-2003 02:32 PM
Inherited DropDownList Designer problem Ron Vecchi ASP .Net Building Controls 0 09-13-2003 05:43 PM



Advertisments