Author: Schmedlap | Posted on: 9/26/2009 6:54:15 PM | Views : 385

I just implemented some HTML functionality into the comment section of my blog, so that people commenting can style their text with HTML tags (specifically the "blockquote", "br", "em", "p", "strong", and "u" tags). I suspect that there is a much better way of doing it, but I'm not sure what that would be. Here is the C# code that I used...
txtComment.Text = Server.HtmlEncode(txtComment.Text);
                    txtComment.Text = txtComment.Text.Replace("&lt;em&gt;", "<em>");
                    txtComment.Text = txtComment.Text.Replace("&lt;/em&gt;", "</em>");
              & ...

Go to the complete details ...