Is there a standard way to encode a .NET string into JavaScript string for use in MS Ajax? May 9, 2023 by Tarik Have you had a look at HttpUtility.JavaScriptStringEncode?