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

N

~~~ .NET Ed ~~~

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
 
N

~~~ .NET Ed ~~~

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top