Solved

ASP.net VB how to change radio button text color

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

Expert Comment

by:Daniel Van Der Werken
Comment Utility
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
Comment Utility
<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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now