title: Writing my first VB.NET Class
body: <p>I am trying to make 2 variables available throughout my site. I am parsing the URL in order to retreive both of them.</p>
  
  <p>This code on the page itself works fine.</p>
  
  <pre><code>Dim countryLanguage As String
  countryLanguage = (Request.ServerVariables("URL"))
  Dim langVar = (Mid(countryLanguage, 2, 2))
  Dim countryVar = (Mid(countryLanguage, 5, 2))
  </code></pre>
  
  <p>I have created a class file the code for which is below. With this I get a complilation error (BC30451: Name 'Request' is not declared.).</p>
  
  <pre><code>Public Class url_parser
  
      Public Shared Function urlVars(ByVal langVar, ByVal countryVar) As String
          Dim countryLanguage As String
          countryLanguage = (Request.ServerVariables("URL"))
          Dim langVar = (Mid(countryLanguage, 2, 2))
          Dim countryVar = (Mid(countryLanguage, 5, 2))
      End Function
  
  End Class
  </code></pre>
  
  <p>Thanks</p>