Escape/unescape strings between JavaScript and ASP.NET

 

Ref: http://www.garrypassarella.co.uk/2011/05/18/escapeunescape-strings-between-javascript-and-asp-net/

The Microsoft.JScript library has a couple of handy methods for just this. You will have to reference this in your project by right clicking References and adding a reference to the library.

Response.Write(Microsoft.JScript.GlobalObject.escape(quote));

space –> %20

& –> %26

….

Comments

Popular posts from this blog

Setup SharePoint 2010

Register CSS to SP Master Page