Header Ads

Replace Apostrophe

When we pass string to Java script which contains apostrophe, we will get a problem. to resolve that see the following line of code:

lnkBtnSave.Attributes.Add("onclick", "alert('" + lblMsg.Text.ToString().Replace("'", @"\'\") + "'");

No comments:

Powered by Blogger.