PDA

View Full Version : Encoding Links


ldiuf
09-19-2002, 01:04 PM
I was wondering if someone can tell me what the syntax is for makeing a normal link look like it's been encoded?

For instance...

Response.redirect "http://www.blah-blah.com"
would look like "http%24%83%83www%93blah%92blah%92com

In the address bar. (BTW those percents are not actually not correct. I'm just giving an example)

Thanks for the help.

Cheers,
Larry:thumbsup:

whammy
09-19-2002, 01:19 PM
Server.URLEncode()

:)

ldiuf
09-19-2002, 01:44 PM
Could you please show me what I did wrong?

<%
Response.Redirect "Server.URLEncode(http://www.google.com)"
%>

whammy
09-19-2002, 03:33 PM
<%
Response.Redirect(Server.URLEncode("http://www.google.com"))
%>

You just had the quotes in the wrong places and left out a right parentheses.

However, Server.URLEncode() won't do anything different to http://www.google.com - since there are no spaces or special characters in the URL to encode.