title: How to correctly use the ASP.NET FileUpload control
body: <p>I'm trying to use the FileUpload control in ASP.NET</p>
  
  <p>Here's my current namespace setup:</p>
  
  <pre><code>using System;
  using System.IO;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.UI.WebControls.WebParts;
  </code></pre>
  
  <p>And within my class, I'm just using:</p>
  
  <pre><code>FileUpload fileUpload = new FileUpload();
  </code></pre>
  
  <p>However, none of the attributes that are normally part of FileUpload seem to be available... such as .HasFile. I'm attempting to make the Button click  method in the code behind, I have noticed that most of the usage of .HasFile is in the code in front, however it was my understanding that this shouldn't matter.</p>
  
  <p>Does anyone know why?</p>