Re: Attributes.Add not rendering for RadioButtonList ListItem

Discussion in 'ASP .Net' started by Karl, Sep 2, 2004.

  1. Karl

    Karl Guest

    Earl:
    This is by design. The ListItem (which myRadioButtonList.Items(0) returns)
    isn't actually a Control/WebControl. As such it doesn't go through a
    Render/RenderAttribute stage. if you dissassemble RadioButtonList you'll
    see the actual checkboxes get rendered in IRepeaterInfo.RenderItem() which
    shows the limit to what you can do with listitems...honestly, I'm not sure
    why you are able to write into the Attribute property...doesn't quite seem
    right...

    Karl

    "Earl Teigrob" <> wrote in message
    news:...
    > I have a RadioButtonList Control and need to add attributes for javascript
    > events such as onclick but can not get the attributes to render to the

    page
    > by using the following code:
    >
    > myRadioButtonList.Items(0).Attributes.Add("style", "font-bold:true")
    >
    > I have tried to impliment this in the Page_Load and Page_PerRender Events.
    > If I try to use an out of range index, it errors out as it should.
    >
    > What am I missing???
    >
    > Thanks
    >
    > Earl
     
    Karl, Sep 2, 2004
    #1
    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:
    469
    Mad Scientist Jr
    Jun 29, 2004
  2. Jim in Arizona
    Replies:
    7
    Views:
    943
    Badass Scotsman
    Nov 22, 2006
  3. Nathan Sokalski
    Replies:
    0
    Views:
    829
    Nathan Sokalski
    Oct 25, 2007
  4. Nathan Sokalski
    Replies:
    1
    Views:
    802
    Nathan Sokalski
    Nov 28, 2007
  5. Dunno
    Replies:
    0
    Views:
    204
    Dunno
    May 16, 2005
Loading...

Share This Page