title: VB.Net: Including common code in multiple files
body: <p>I'm new to the .NET platform (old-time ASPer) and for a project have a simple pair of .aspx scripts that take some querystring data and process it. They both make use of the same Subs, Functions in them, so naturally I'd like to move the code to a common resource.vb file. Having done some reading, it looks like my options are a Code-Behind type setup, and placing the Subs, Functions in a .vb file and placing that file in App_Code.</p>
  
  <p>So, the Code-Behind model doesn't seem to make sense here, as the functions are shared by both files. Placing the Subs and Functions in /App_Code/resources.vb and I am getting the following error when trying to call any of the routines:</p>
  
  <pre><code>Statement is not valid in a namespace
  </code></pre>
  
  <p>Reading <a href="https://stackoverflow.com/questions/2995816/include-code-in-asp-net/2998052#2998052">this answer</a>, I thought the last solution would be fine, but not so. Any pointers? This whole solution is meant to be simple and portable, something someone can deploy into their domain by simply uploading the files, so portability is also important.</p>
  
  <p>Thanks,</p>
  
  <p>Paul</p>