Simple question, regarding .net syntax more than anything.
I'm a vb6 coder, new to .net and its way of working... anyway, I'm using the follow bit of code. If the Querystring item "ID" is not passed then szPage will be 'Nothing'.

VB Code:
  1. Dim szPage as String = Request.QueryString("ID")
  2. If szPage = "12345" Then
  3.   'Do This
  4. Else
  5.   'Do Summat Else
  6. End If

If ID is not passed this produces an error ... Now I can sort this by doing;

VB Code:
  1. If Not (Request.QueryString("ID") Is Nothing) Then
  2.   Dim szPage as String = Request.QueryString("ID")
  3.   If szPage = "12345" Then
  4.     'Do This
  5.   Else
  6.     'Do Summat Else
  7.   End If
  8. Else
  9.   'Error
  10. End If

I know .NET has some much better ways of working with objects and I am very tuned into vb6 which I find can be a prob when using .net. This code just seems a bit long winded for something thats going to be very common... is there a BETTER/shorter way of writing this code?

Cheers for any replys,

GaZ