
350
|
Chapter 16: The HttpRequest Class
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
query string values are appended to the URL, it is relatively simple to statically
add query strings to links within pages or dynamically create anchor tags with
query string values appended. In fact, many online stores use this method to drive
their catalog pages (by passing a product ID appended onto a link to the page
designed to display the product). That page can then retrieve the ID by using the
QueryString collection.
Because query string values are passed as plain text appended to the URL, they are
more vulnerable to tampering than values passed as a result of a POST operation.
If you need to pass important data or data that, if tampered with, could create
problems for your application, you should consider encrypting values before
adding them to the query string or using another method to pass the values.
Certain characters used in query string processing, including &, ?, %, and +, must
be encoded to avoid confusion between their use in your key/ value pair and their
role as special characters in a query string. The following table lists the encoding
for each of these special characters:
Rather than memorizing these values, you could make your life easier by simply
using the UrlEncode method provided by the
HttpServerUtility class (covered ...