Site Search:
Sign in | Join | Help
4Penny.net

ASP.NET

Notes, Tricks and Tips on ASP.NET Coding

HTMLEncode

I can never remember this piece of code to encode ASP.NET output:

server.HtmlEncode(string)

 or

httpUtility.htmlEncode(string)

If this is a VB app, you'll need to set a reference to SYSTEM.WEB and use the second example.

 This is code that wil change 'D&B' into 'D&B', so that you can load it into an XML doc.

Comments

No Comments

About Steve Gray

Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.