Previous in Contents Next in Contents

Page.RequestString Method

The RequestString method retrieves a value from a URL query string or form post variable and performs string processing on it, based on the specified locale.

This processing may involve stripping out leading and trailing white spaces, stripping out carriage returns, checking the string's length against a specified range, and validating the string based on the specified or default locale.

Syntax

Page.RequestString(Name, Default, MinStrLen, MaxStrLen, StripWhiteSpaces, StripReturn, Case, Locale)

Parameters

Name
The name of the URL query string or form post variable to retrieve.
Default
Optional. The string to return if the specified query string or form post variable does not exist or contains no value. If this parameter is not supplied, the method returns Null in this case.
MinStrLen
Optional. A number that indicates the minimum length against which the length of Name must be validated.
MaxStrLen
Optional. A number that indicates the maximum length against which the length of Name must be validated. The default value is 65535.
StripWhiteSpaces
Optional. A Boolean value that indicates whether the leading and trailing white spaces should be stripped from the string. The default value for this parameter is False.
StripReturn
Optional. A Boolean value that indicates whether the carriage returns should be stripped from the string. The default value for this parameter is False.
Case
Optional. A number that indicates the case to which the string should be converted. The default value for this parameter is zero (0), which results in no modification to the case of the string. If Case is 1, the string is converted to uppercase. If Case is 2, the string is converted to lowercase.
Locale
Optional. A number that specifies the locale to be used as the basis of the conversion. If this value is not specified, RequestString uses the value of the DataFunctions object's Locale property.

Example

In the following example, the value of a field on the purchase form (filled out by the customer) is read into the variable ship_to_name. Because the Default parameter is specified as null, RequestString returns Null if the field is empty or missing, or if the string is outside of the range of 1 to 100 characters:

ship_to_name = page.RequestString("ship_to_name", null, 1, 100)

Related Topics


© 1997-2000 Microsoft Corporation. All rights reserved.