title: Persist FileUpload Control Value
body: <p>I have asp.net FileUpload control inside an update panel. When I click upload button, I am reading the file for some code, if code not found then I am showing ModalPopup for selecting a user from dropdown, otherwise uploading and emailing the file to user of that Code(this code is saved in Database).
  If code not found,its displaying ModalPopup and removing the selected file, I want to persist the selected file after post back.
  This is my code</p>
  
  <pre><code>&lt;asp:UpdatePanel ID="UpdatePanel3" runat="server" &gt;
      &lt;ContentTemplate&gt;
          &lt;asp:FileUpload ID="FileUpload1" runat="server"  /&gt;
          &lt;asp:RequiredFieldValidator ID="rfvFileupload" ValidationGroup="validate" runat="server" ErrorMessage="* required" ControlToValidate="FileUpload1"&gt;&lt;/asp:RequiredFieldValidator&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>and on Button Click</p>
  
  <pre><code>protected void btnupload_Click(object sender, EventArgs e)
  {
      //Reading the file and Checking from Database
      if(codefound)
      {
          //Sending email to the user of the Code
      }
      else
      {
          ModalPopupExtender1.Show();
      }
  }
  </code></pre>
  
  <p>How can I persists  the value of Upload control on post back?</p>