title: How to save a fileupload to a viewstate after postback?
body: <p>I have a FileUpload and multy control on page. All controls are located inside the updatepanel other than FileUpload.</p>
  
  <p>After post back, i save fileupload in a viewstate.</p>
  
  <pre><code>private FileUpload Files
  {
      get { return (FileUpload)ViewState["Files"]; }
      set {
          ViewState["Files"] = value;
      }
  }
  
  
  .
  .
  .
  if (ImageFileUpload.HasFile)
   {
      Files = ImageFileUpload;
   }
  </code></pre>
  
  <p>But i get error </p>
  
  <blockquote>
    <p>Type 'System.Web.UI.WebControls.FileUpload' in Assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.</p>
  </blockquote>