Solved

ASP.net VB how to change radio button text color

Posted on 2011-02-22
2
1,022 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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