all groups > asp.net building controls > october 2004 >
You're in the

asp.net building controls

group:

How to use <asp:ListItem> as part of my own control


How to use <asp:ListItem> as part of my own control ~~~ .NET Ed ~~~
10/31/2004 3:59:53 PM
asp.net building controls:
That is the question indeed. I have a user control that needs to render some
content, the content is actually made of items. Because of that I would like
to use <Asp:ListItem> as inner contents of my user control as follows:

<uc:MyControl runat=server id=MyControl1>
<asp:ListItem text="item text" value="item value">
</uc:MyControl>

My question is whether that is possible. And if so do I need to create my
own ListItem user control? or can I use the regular ListItem.

Then, how do I access the attributes of these ListItem inner contents from
within the code of my user control?

Thx,
Emilio

Re: How to use <asp:ListItem> as part of my own control ~~~ .NET Ed ~~~
11/1/2004 2:01:41 AM
Never mind, after more exhaustive search (my eyes are in pain) I found a few
examples
that implemented something similar and I got this working.

[quoted text, click to view]

Re: How to use <asp:ListItem> as part of my own control Sergio Florez M.
11/29/2004 1:58:36 PM
How? Can you post the examples?

--
Sergio Florez M.
Miembro activo de www.alianzadev.net
Medellín, Colombia.
Visita mi blog:
http://www.alianzadev.net/portal/alias__Rainbow/lang__es-MX/tabID__3345/DesktopDefault.aspx


[quoted text, click to view]

AddThis Social Bookmark Button