>Maybe I did not understand, is this what you want?
>
>string x = "I'm a girl";
>x = Server.UrlEncode(x).Replace("'", "\\'"));
>
>returns: "I\'m+a+girl"
>
>Craig is correct, you need to escape the backslash in C#.
For me it was returning \\, but I'm running the full test again right now. I put @ in the replace command and I'm going to test if it would work. I was getting \\ in the immediate window.
If it's not broken, fix it until it is.
My Blog