acidzombie24 acidzombie24 - 1 year ago 93
HTML Question

Escape text for HTML

How do i escape text for html use in C#? I want to do


and have


show up as plain text instead of blah only with the tags part of the html :(.
Using C# not ASP

Answer Source
using System.Web;

var encoded = HttpUtility.HtmlEncode(unencoded);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download