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

Discussion in 'ASP .Net Building Controls' started by ~~~ .NET Ed ~~~, Oct 31, 2004.

  1. 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
     
    ~~~ .NET Ed ~~~, Oct 31, 2004
    #1
    1. Advertising

  2. 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.

    "~~~ .NET Ed ~~~" <> wrote in message
    news:urU%...
    > 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
    >
    >
     
    ~~~ .NET Ed ~~~, Nov 1, 2004
    #2
    1. Advertising

  3. 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


    "~~~ .NET Ed ~~~" <> wrote in message
    news:...
    > 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.
    >
    > "~~~ .NET Ed ~~~" <> wrote in message
    > news:urU%...
    > > 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
    > >
    > >

    >
    >
     
    Sergio Florez M., Nov 29, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    2
    Views:
    479
    Mad Scientist Jr
    Jun 29, 2004
  2. darrel
    Replies:
    2
    Views:
    2,177
    darrel
    Mar 24, 2005
  3. Stefan Siegl
    Replies:
    1
    Views:
    784
  4. Jim in Arizona
    Replies:
    7
    Views:
    950
    Badass Scotsman
    Nov 22, 2006
  5. Nathan Sokalski

    Formatting text in the asp:ListItem control

    Nathan Sokalski, Jul 27, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    489
    Nathan Sokalski
    Jul 27, 2007
Loading...

Share This Page