Javascript Escape/UnEscape and C# UrlEncode/UrlDecode, Encode/decode
In Javascript I use following code to get the input of user name:
sUserName=escape($get('ctl00_SampleContent_TextBox_Name').value);
In order to display this string to user using C#, the following code is used:
System.Text.StringBuilder strMessageBody = new StringBuilder();
strMessageBody.Append("Hi ");
strMessageBody.Append(HttpContext.Current.Server.UrlDecode(sUserName));
strMessageBody.Append(":
");
strMessageBody.Append("Thanks for ....");
sUserName=escape($get('ctl00_SampleContent_TextBox_Name').value);
In order to display this string to user using C#, the following code is used:
System.Text.StringBuilder strMessageBody = new StringBuilder();
strMessageBody.Append("Hi ");
strMessageBody.Append(HttpContext.Current.Server.UrlDecode(sUserName));
strMessageBody.Append(":
");
strMessageBody.Append("Thanks for ....");
Comments
Post a Comment