Solved

ASP.net VB how to change radio button text color

Posted on 2011-02-22
2
1,021 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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 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