how to test if a Querystring item exists?

  • Thread starter Thread starter Marcio Watanabe
  • Start date Start date
M

Marcio Watanabe

If I use Request.QueryString["page"] for the URL below, an empty
string is returned:
http://listorders.aspx?page=

What is returned if I use Request.QueryString["page"] for:
http://listorders.aspx

I can test the former case easily:
if (Request.QueryString["page"] == string.Empty) {

I thought that would work for the latter case too, but it doesn't.
Is there an easy way to test for the latter case?
 
Sorry if you didn't understand my earlier response : test for null :

if (Request.QueryString["page"] == null) {
.....
 
Back
Top