Thursday 4 July 2013

ASP.NET Javascript Encode on server side

NET Framework Version 4.0 and above and has a method called

HttpUtility.JavaScriptStringEncode()

which can be used to encode string values for JavaScript. It is a handy method which will take care of all special characters in the string including new line characters. http://msdn.microsoft.com/en-us/library/dd991914.aspx

http://itmeze.com/2011/03/21/javascript-encode-on-server-side-medium-trust-environment/

No comments:

Post a Comment