title: ASP .NET VB Get Posted File
body: <p>I have inherited an old ASP/VB Web Application project, and am trying to get it running on my computer (Win 7, VS Web Express 2012), but have never done any ASP or VB before.</p>
  
  <p>I have an <code>Upload2.aspx</code> file and an <code>Upload2.aspx.vb</code> file.</p>
  
  <p><code>Upload2.aspx</code> looks like this:</p>
  
  <pre><code>&lt;%@ Page Language="VB" AutoEventWireup="false" CodeFile="Upload2.aspx.vb" Inherits="Upload2" %&gt;
  ...
  &lt;asp:FileUpload ID="fuData" runat="server" /&gt;
  </code></pre>
  
  <p><code>Upload2.aspx.vb</code> looks like this:</p>
  
  <pre><code>Partial Class Upload2
      Inherits System.Web.UI.Page
  
      Private Sub manageUpload()
          Dim pf As HttpPostedFile = fuData.PostedFile
  ...
  </code></pre>
  
  <p>For some reason, it is giving me an error at fuData:
  <code>'fuData' is not declared. It may be inaccessible due to its protection level.</code></p>
  
  <p>Shouldn't it automatically be able to access the variable from the id on the aspx page?</p>