I'm passing a string from one ASP template to another. The string may contain spaces so I call URLEncode, which works well as far as preventing the 400 Error for a malformed page. However, when I encode the Query String, it seems to muck up the code that gets the values from the Query String. Is there a "decode" function that I need to use?
When you are passing values in a Query String, you are building a string that looks like this:
Remember to URLEncode only the value1 and value2 strings. Do not URLEncode the key1 and key2 strings. So your code should look like this:
"key1=" & Server.URLEncode("value1") & "&key2=" & Server.UrlEncode("value2")
This code will pass the proper "value1" and "value2" even if they contain spaces or punctuation characters.