devxlogo

Be Careful When Using Request Object Collections to Read a Form Variable in ASP

Be Careful When Using Request Object Collections to Read a Form Variable in ASP

You can use the shorthand way to read Request object variables in ASP, like this:

sVariable = Request("txtVariable")

However, you must be careful when using it this way. The Request object has many collections, such as the QueryString collection, the Form collection, and Cookies collection. Therefore, when you use this shorthand to read a collection, it will read the QueryString collection first, then the Forms collection, and finally the Cookies collection. So you might retrieve the value of txtVariable from either the QueryString collection or Forms collection, while actually expecting it from the Cookies collection.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist