Encode the query field for encode operations:
The use of a query field to pass information between different home pages must be encode (note that there is a different page pass), because if you do not, you are likely to get the recipient of the message to receive some strange string that you do not expect.
Note: In fact, if there are no special characters in the query field, such as spaces and punctuation, you can also do without encode operations.
In fact, this encode operation is very easy, there is a specific way to perform this operation: that is the Server.URLEncode () method, look at the following example:
<a href= "Response.asp? Message=<%=server.urlencode ("This Query String has been URL encoded.") %> "> Click here </a>
Please note: Do not encode the name of the query field and the equal sign, just encode the value.
After the encode operation, the query field is as follows:
message=this+query+string+has+been+url+encoded%2e
There is no need to consider decoding the string above, which is handled automatically by the Active Server page. For example, suppose you have such a script in response.asp:
<%=request.querystring ("message")%>
At this point, the result is:
This Query String has been URL encoded.