Change CssClass in

I have a label, <asp:Label ID="lblInfo" runat="server" Text="" />, and I want to set the CssClass of the label to “RedText” if one condition is met and to “BlackText” if another condition is met.

This is in an using VB for the code behind.

Any Ideas?
Who is Participating?
Paul JacksonConnect With a Mentor Software EngineerCommented:
Simply set the cssclass in the code behind:

If ....  Then
    lblInfo.CssClass = "RedText"
    lblInfo.CssClass = "BlackText"
End If
us1975mcAuthor Commented:
Thanks.  Great work and super fast!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.