>>>In JavaScript the ' should be replaced with \', however simply replacing newtitle doesn't work.
>>>
>>>Do you have ideas how can I solve this problem?
>>>
>>>Thanks a lot in advance.
>>
>>If special characters are needed as part of the value of the parm, you should URLEncode it and then URLDecode it when you need to extract the value again.
>
>What is the order of changes in this
>
>"&title=" + Server.UrlEncode(newtitle).Replace("'", "\'") + "';";
>
>Does it first do UrlEncode and then tries to replace ' with \' or vice versa?
>
>I think for JavaScript ' should be replaced with \' but the above code doesn't do this for me. How should I fix it?
>
>Thanks a lot again for your help.
URLEncode will be performed before the Replace method. At the time your Replace is run, there should be no "'" present in the string because it will have been encoded.