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