Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.net VB how to change radio button text color

Posted on 2011-02-22
2
Medium Priority
?
1,043 Views
Last Modified: 2012-05-11
I have a radio button list in ASP.NET using VB. Would like to change the font color of one of the list items. For instance, how do I make the text "Green Suggestion" to be the color green when it is rendered?

 <asp:RadioButtonList ID="radioAct" runat="server" AutoPostBack="True"
                       
          RepeatDirection="Vertical" Width="609px">
          <asp:ListItem Value="Environmental Issue<">Environmental Issue</asp:ListItem>
          <asp:ListItem Value="General Safety">General Safety Suggestion</asp:ListItem>
          <asp:ListItem Value="Green Suggestion">Green Suggestion</asp:ListItem>
          <asp:ListItem Value="Near Miss/Accident">Near Miss/Accident</asp:ListItem>
          <asp:ListItem Value="Unsafe Act/Behavior">Unsafe Act/Behavior</asp:ListItem>
          <asp:ListItem Value="Unsafe Condition">Unsafe Condition</asp:ListItem>
</asp:RadioButtonList>
0
Comment
Question by:neptuneit
2 Comments
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 34955862
This will work:
<asp:ListItem Value="Green Suggestion"><span style="color: Green;">Green Suggestion</span></asp:ListItem>
0
 
LVL 8

Accepted Solution

by:
Den_HBR earned 2000 total points
ID: 34955898
<asp:RadioButtonList ID="radioAct" runat="server" AutoPostBack="True" RepeatDirection="Vertical" Width="609px" >
          <asp:ListItem Value="Environmental Issue<">Environmental Issue</asp:ListItem>
          <asp:ListItem Value="General Safety" >General Safety Suggestion</asp:ListItem>
          <asp:ListItem Value="Green Suggestion" style="color: green">Green Suggestion</asp:ListItem>
          <asp:ListItem Value="Near Miss/Accident">Near Miss/Accident</asp:ListItem>
          <asp:ListItem Value="Unsafe Act/Behavior">Unsafe Act/Behavior</asp:ListItem>
          <asp:ListItem Value="Unsafe Condition">Unsafe Condition</asp:ListItem>
</asp:RadioButtonList>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question