Show different color strings(text) in textbox asp.net
<p>In my asp.net website i have a textbox which provides the log information. I am using this log to display the error,success and other information. What i want to do is i want to show the result text in textbox in color according to the type of log. For eg; i want to display error as red text, success as green and so on.</p>

<p>I tried the following code but using this  code changes the color of entire content of textbox.</p>

<pre><code>    /// &lt;summary&gt;
    /// colorIndex (0 = default, 1 = red, 2 = green)
    /// &lt;/summary&gt;
    /// &lt;param name="logValue"&gt;&lt;/param&gt;
    /// &lt;param name="colorIndex"&gt;&lt;/param&gt;
    private void writeToLog(string logValue, int colorIndex)
    {
        if (colorIndex == 0)
        {
            TextBox2.ForeColor = Color.Black;
        }
        else if(colorIndex == 1)
        {
            TextBox2.ForeColor = Color.Red;
        }
        else if(colorIndex == 2)
        {
            TextBox2.ForeColor = Color.Green;
        }

        TextBox2.Text = "[ " + DateTime.Now + "] " + logValue + Environment.NewLine + TextBox2.Text;

    }
</code></pre>

<p>Actually i want the output as follows:</p>

<p><img src="http://i.stack.imgur.com/exEAO.png" alt="enter image description here"></p>

<p>You can see in above output there are three different colors of text in same texbox.
This output is actually from the desktop application. And i want to show same type of output in asp.net web page? How can i do it? Please help. Thanks in advance!!</p>
