Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if QueryString item exists.

Status
Not open for further replies.

digiduck

Programmer
Apr 4, 2003
95
US
I'm having trouble finding a good way to check if a querystring item exists before I try and access it. Right now I'm doing the following but there has to be a better way...

Code:
try
{
    x = Request.QueryString["someItem"];
}
catch { }

How can I find out if "someItem" is in the queryString before accessing??? Thanks for the help :)

ud


tkc
 
Here's the VB.NET way:
Code:
If Not Request.QueryString("someItem") Is Nothing Then
...do your magic...
End If
 
Thanks! that worked! I thought I'd already tried that though... :x O well. Thanks for the help :)

ud


tkc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top