title: VB.NET How to get integer from Request
body: <p>I want to get an integer from the URL querystring, but I want to protect against strings being entered. So for example;</p>
  
  <pre><code>http://mydomain.com/index.aspx?page=1
  
  Dim iPageID as Integer = Request("page")
  </code></pre>
  
  <p>I want to get the '1' and save it as an integer variable, but the page errors out if I enter the below address;</p>
  
  <pre><code>http://mydomain.com/index.aspx?page=string
  </code></pre>
  
  <p>I've tried using CInt and CType, but that just brings a 'string cannot be converted to integer' issue. I'm sure there's something simple I can do, but I've been banging my head against the wall for almost an hour now and I just want to get this small thing sorted.</p>