Posted on: 10/17/2012 1:11:36 AM | Views : 409

Hi Everyone,
I'm trying to check to see if there is a value in the querystring, and if not assign a default value to a variable in my code behind.  Unfortunately, the null check itself is giving an error indicating that the "Value cannot be null."   I have tried the following:
if (Request.QueryString == null)
{
//Do stuff
}
Also:
if (Request.QueryString.Count = 0)
{
//Do stuff
}
And:
if (Request.QueryString["variable"] != null)
{
//Do stuff
}
In each of these three cases, the null check fails with the aforementioned error.  The full text of the error follows.  Any ideas what I'm doing wrong?
Thanks!
System.ArgumentNullException was unhandled by user code
Message=Value cannot be null.
Parameter name: String
Source=mscorlib
ParamName=String
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles o ...

Go to the complete details ...