Escape Quote in C# for javascript consumption

For .net 4.0 + there is standard
HttpUtility.JavaScriptStringEncode

For earlier west wind solution described by Lone Coder is quite nice

Leave a Comment