views:

70

answers:

2

I want to dump out some HTML I am rendering in a C# class on an ASPX page. But not as the rendered HTML but the actual HTML before the browser renders it.

Is this possible?

+6  A: 

Server.HtmlEncode should do the trick...

Arjan Einbu
+1  A: 

HttpUtility.HtmlEncode()

EDIT

If you take a look in reflector, you'll see that Server.HtmlEncode() calls HttpUtility.HtmlEncode()

ScottE