Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Attributes.Add not rendering for RadioButtonList ListItem

Reply
Thread Tools

Re: Attributes.Add not rendering for RadioButtonList ListItem

 
 
Karl
Guest
Posts: n/a
 
      09-02-2004
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:BCD75A43-705F-4384-8049-...
> 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



 
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
RadioButtonList does not allow you to select a ListItem other than the first one that has a specified value Nathan Sokalski ASP .Net 1 11-28-2007 02:07 AM
RadioButtonList does not allow you to select a ListItem other than the first one that has a specified value Nathan Sokalski ASP .Net Web Controls 1 11-28-2007 02:07 AM
RadioButtonList.SelectedIndexChanged not raised when the ListItem has Selected="True" Nathan Sokalski ASP .Net 0 10-25-2007 02:31 PM
<asp:ListItem Value="0">blank choice</asp:ListItem> ? Jim in Arizona ASP .Net 7 11-22-2006 08:31 AM
ropdownlist listitem.value not working - returns listitem.text instead Mad Scientist Jr ASP .Net 2 06-29-2004 01:13 PM



Advertisments