Basically if you call for a QueryString item that does not exist it passes you an empty string (which i find much easier then the PHP methods for checking, darn optonal errors):
Code:
If Request.QueryString("aField") = "" Then
Response.Write "It don't exist!"
Else
Response.Write "aField is " & Request.QueryString("aField")
End If
You can also use things like <> or even length checks. Basically it gives you an empty string for non-existent fields, which means that whether or not there was an input on the previous page with that name, you can check for both empty input values and no input field by that name in one easy statement.
-T
01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
Help, the rampaging, spear-waving, rabid network gnomes are after me!
This code will also report "it doesn't exist" for zero-length values (blah.asp?aField=). If you have to make that kind of distinction, use IsEmpty(Request.QueryString("aField")).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.