Are there color enum with ASP.NET

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I cant to write a function to manage the font color of my web.
The function is like:


using System.Drawing;
public static string Font(string input, Color my)
{
string sRV = "";
sRV = "<font color='" + myColor.ToString() + "'>" + input + "</font>";
return sRV;
}

but when I use
FontColor("Test", Color.Red) to call the function,
The return string is
<font color='Color [Red]'>Test</font></font><br>

The color is mistake.

I think I use the wrong namespace.

How can I manage the HTML color?
 
sRV = "<font color='" + myColor.ToString() + "'>" + input + "</font>";

Instead of myColor.ToString, try calling ColorTranslator.ToHtml.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top