Page.RequestDefault

Ee783809.c++_on(en-US,CS.10).gifEe783809.vb_off(en-US,CS.10).gif

Use this method to retrieve a value from a URL query string or form post variable and return the value as a string.

Ee783809.important(en-US,CS.10).gif Important

  • This method is included for backwards compatibility with Site Server 3.0 Commerce Edition.

Definition

Function RequestDefault(bstrName As String,vtDefault As Variant) As Variant

Parameters

bstrName

A String that contains the name of the URL query string variable to retrieve.

vtDefault

A VARIANT that contains the value to return if the requested URL query string or form post variable contains an empty or a NULL value, or is not present in the request string. If this parameter is not supplied, the method returns NULL.

Return Values

If this method completes successfully, it returns a Variant that contains the processed value.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

This method is designed so that if a field on a form is blank, or the form does not contain the field, the value returned by default is NULL. NULL is generally the appropriate value to store to a database when a value is not present. If you need the result to be an empty string in the case of a missing value, supply an empty string as the Default parameter.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' The following example attempts to retrieve the value for 
' the URL query string variable shopper_phone. Because no
' Default argument is supplied, if this URL query string 
' variable has no value, the call returns Null.
' vShopper_phone is a Variant
' oPage is a Commerce.Page object
vShopper_phone = oPage.RequestDefault("shopper_phone")

See Also

Page Object


All rights reserved.