If request.querystring("key") is nothing then
Or
If Not request.querystring("key") is nothing then
or if the key exists but has no value set
try
if not request.querystring("key").toString.trim.length then
DOntdothis()
end if
' this always throws an exception with a null value or of course you can jus
return dothis()
Catch ex as exception
return Dontdothis()
end try
Actually you hit on the simplest way to do it, if you need to tell the user
what is wrong this also works great with a custom validator.
try
catch ex as exception
finally
end try
Put the code to handle things without the proper key into catch.
"Mark" <vb********@cableone.net> wrote in message
news:eG*************@TK2MSFTNGP12.phx.gbl...
Hello
Can anyone tell me how to check if a a querystring is present or not
I.E. If request.querystring("key") is in the url or not
because when i try to reference it in anyway and its not there I get
an error there has to be an easier way then having to put all the checks in a
try catch statement
Thanks
Mark
x-- 100 Proof News -
http://www.100ProofNews.com
x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
x-- Access to over 800 Gigs/Day - $8.95/Month
x-- UNLIMITED DOWNLOAD