View Full Version : Avoid ' in the URL

11-18-2007, 12:39 PM
hmm..i duno how to elaborate this problem that i m facing. ok, let say ..i have a URL wit id number such as
when i add the symbol ' at the end of the url (like that:www.abc.com/memberpage.asp?memberid=12'), and enter, it will display error for my page.
But when i try to put a ' at this web page here, it will not display any error, how can i do this with ASP languagE?how can i avoid it using ASP language ?
plz help and guide.thank you.

11-18-2007, 01:02 PM
You can use the Server.URLEncode() method to avoid symbols that interfere with the querystring.

Dim mybadstr
mybadstr = "www.'hello'2'birds'.com/mydirectory/'string'=3
Dim mynewstr
mynewstr = Server.URLEncode(mybadstr)