Try "
URLEncode
"ing the quotes:
Double quote (
"
) becomes
"
Single quote (
'
) becomes
'
If the
url
is being generated dynamically, you can use
Server.UrlEncode(url)
to automatically encode the whole
url
.
If you only need to encode part of the
url
, you can do something like this:
string url = string.Format("~/app/4/Search/{0}", Server.UrlEncode(searchTerm));
I highly recommend that
url
s (in whole or part) entered in a textbox be encoded prior to use.