Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
From: "Dunno" <adrian.lehm...@redox.com>
Date: 15 May 2005 20:20:51 -0700
Local: Sun, May 15 2005 11:20 pm
Subject: A Solution for Rendering Attributes into the Individual Items of a RadioButtonList
It's long been a problem that in some ASP.NET WebControls developers
have not been able to render custom/additional attributes. The RadioButtonList is one such control. For instance you'd think that you could add attributes to the individual radio buttons by iterating through the RadioButtonLists.Items collection as so: foreach(ListItem item in rbl.Items) } No good. They attributes just don't render. The framework RadioButtonList implements the IRederInfoUser interface. The only method that needs to be implemented is the RenderItem method. public class CustomRadioButtonList : RadioButtonList, IRepeatInfoUser // Add custom attributes here. radioButton.RenderControl(writer); } It may not be the most elegant way around this problem but it has worked for me. Happy Coding. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||