Hi all,
I'm using ASP.Net 4.0 with MVC 2. I'm recieving user content that may or may not be Html Encoded already. I've read http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx which was interesting but what I need is a way to ensure the content is encoded without double encoding. I don't have control of the input process.
E.g.
User Input:
& < < > >
Output if encoded:
&amp; &lt; < > &gt;
Won't display correctly
Output if not encoded:
& < < > >
This won't validate correctly