title: How better check Request.QueryString string parameter for null?
body: <p>I need explanations.. I using C#.NET to web applications, I always write:</p>
  
  <pre><code> string val = Request.QueryString["foo"];
  </code></pre>
  
  <p>and then </p>
  
  <pre><code>if(!string.IsNullOrEmpty(val)) 
  </code></pre>
  
  <p>What's the difference:</p>
  
  <pre><code>string val = Request.QueryString["foo"];
  </code></pre>
  
  <p>I was advised to do:</p>
  
  <pre><code>string val = Request.QueryString["foo"] as string;
  if(!string.IsNullOrEmpty(val)) 
  </code></pre>
  
  <p>What's the difference?</p>