0

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?

1
  • I'd like to know this. Code and pre tags work for everything except HTML. I don't want to tell you to use XML refernces which is the only work around as the answer as Im sure there must be a better way. Commented Jul 6, 2009 at 12:33

2 Answers 2

6

Server.HtmlEncode should do the trick...

Sign up to request clarification or add additional context in comments.

Comments

1

HttpUtility.HtmlEncode()

EDIT

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.