INFO: ASP's Request.Form and Request.QueryString Return ObjectsLast reviewed: December 11, 1997Article ID: Q173317 |
The information in this article applies to:
SUMMARYThe values returned by Request.Form and Request.QueryString are actually objects, rather than strings as you would expect. This causes subtle conversion problems in server-side scripts, especially JScript.
MORE INFORMATIONThe following call evaluates to TRUE:
<% IsObject(Request.Form("Valid_Form_Value")) %>This is due to the fact that the Request object returns an IRequestDictionary object rather than a string. In most cases, this subtle fact goes unnoticed because the scripting engine simply substitutes the "Default Value" of the object into scripts as necessary. This is what happens when you assign the requested value to a variable, as shown here:
<% MyValue = Request.QueryString("Valid_QueryString_Value") %>However, there are some scenarios where this subtlety causes problems. In particular, it may be necessary to perform explicit casts in JScript or when calling automation methods on objects. Another option is to use the .item syntax to extract the default value of the object. The following IsObject call evaluates to FALSE and demonstrates use of the .item syntax.
<% IsObject (Request.QueryString("Valid_Form_Value").item) %> REFERENCESFor the latest Knowledge Base artices and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/vinterdev/ Keywords : AXSFJScript AXSFVBS Technology : kbInetDev Version : WINDOWS NT:1.0,1.0b Platform : NT WINDOWS Issue type : kbinfo |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |