In VBScript there is essentially only one datatype, the variant datatype
which changes behavior based upon how it is referenced. That's why a
variable can be used to perform mathematical functions in one case, then
later be treated as a string. In .Net languages there is no variant so
things behave a little different. The Request.Querystring[key] returns an
object. When the key is not found, it returns null instead. An empty string
is not a null value since a null is a very special case all by itself. You
can test to see if the key is null first. You'll have to forgive me, but I
haven't played with VB in a while so I'll show the C# code instead and you
should be able to recognize how to do it in VB.
if(Request.Querystring["id"] == null)
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Guoqi Zheng" <no@sorry.nl> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
On my application, I need to have different action based on the pass in
query string. When the query string is not presented, I try to use
If request.querystring("id") ="" THEN ......
This is what I did in trational asp, however if I did abov in ASP.NET, I
always got an error of "Object reference not set to an instance of an
object. "
How should I solve the problem?
--
Kind regards
Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com