O'Reilly logo

ASP in a Nutshell, 2nd Edition by A. Keyton Weissinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

QueryString — Request.QueryString( element )[( key )|.Count]

Synopsis

The QueryString collection allows you to retrieve the information sent by the client using the HTTP Get method with an HTML form and data appended to the URL when the page is requested. The QueryString collection is less capable than the Form collection, since there is a limit to the amount of data that can be sent in the header of an HTTP request. In my experience, this limit is around 2000 characters. More characters than this, sent as part of the QueryString, will not be processed, although the script still executes.

The QueryString collection, like the other ASP collections, has the following properties:

Item

Returns the value of a specific element in the collection. To specify an item, you can use an index number or a key. In the case of the QueryString collection, the index number represents the number of the element as it appears in the URL or the number of the element on the HTML form (assuming a GET method is used to send the data). If the POST method is used to submit form data, however, these HTML elements do not exist in the QueryString collection, but rather in the Form collection of the Request object.

Key

Returns the name of a specific element in the QueryString collection. Just as each element's value is represented by the Item property, each element's name is represented by its Key property.

If you do not know the name of a specific key, you can obtain it using its ordinal reference. For example, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required