title: FileUpload control HasFile fails but file is actually available
body: <p>My file upload control is not part of an UpdatePanel. It just resides in a <code>asp:panel</code>. When I step through the debugger I see the FileName property properly populated, FileBytes,PostedFile etc. but HasFile alone is false. I am at my wits end trying to figure this out because the FileName property has the expected value but HasFile is false. This <a href="https://stackoverflow.com/questions/8183910/file-upload-control-hasfile-always-false-name-is-always-empty-string-no-update?rq=1">solution</a> did not help either!</p>
  
  <pre><code>&lt;asp:Panel id="AddEditReport" runat="server" Visible="false" style= "display:inline;" &gt;
   &lt;asp:HiddenField ID="ReportField" runat="server" Value="Report" /&gt;
   &lt;table width="100%"&gt;
        &lt;tr&gt;
          &lt;td&gt;Title:&lt;/td&gt;
          &lt;td&gt;&lt;asp:TextBox ID="TextBox_Report" runat="server" Width="342px"&gt;&lt;/asp:TextBox&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td valign="top"&gt;&lt;asp:Label ID="Description_Label" runat="server" Text="Header Description" /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;asp:TextBox  TextMode="MultiLine" ID="Description" runat="server" Width="342px" height="250px" AutoPostBack="false"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
              &lt;asp:Label ID="DisplayOrder_Label" runat="server" Text="Display Order" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;asp:TextBox ID="TextBox_DisplayOrder" runat="server" Width="42px" MaxLength="2" AutoPostBack="false"/&gt;            
          &lt;/td&gt;          
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;asp:Label runat="server" ID="FileUploader_Label" Text="Copy of file: "/&gt;&lt;/td&gt;
            &lt;td&gt;&lt;asp:FileUpload ID="FileUpload_Report" runat="server"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
   &lt;/table&gt;&lt;/asp:Panel&gt;
   &lt;asp:Panel ID="Button" runat="server"&gt;
      &lt;asp:Button id="Save" runat="server" Text="Save" OnClick="SaveButton_clicked"/&gt;
      &lt;asp:button id="Back" runat="server" Text="Back" OnClick="BackButton_clicked" UseSubmitBehavior="False"&gt;&lt;/asp:button&gt;&lt;%
  int id;
  if (!string.IsNullOrEmpty(Request.QueryString[QuerystringID]))
  {
      id = int.Parse(Request.QueryString[QuerystringID]);
      if (string.IsNullOrEmpty(ReportRepository.GetReportById(id).FilePath))
      {
  %&gt;      &lt;a  onclick="return confirm('Are you sure you wish to delete this heading?')"  href="FileUpload.aspx?id=&lt;%=id.ToString()%&gt;&amp;delete=true" target="_self"&gt;
           &lt;input type="button" value="Delete Heading"/&gt;
      &lt;/a&gt;
   &lt;% 
      }
     }
    %&gt;&lt;/asp:Panel&gt;
  </code></pre>
  
  <p>This is my entire page.  </p>
  
  <p>The code behind snippet where the HasFile fails:</p>
  
  <pre><code>if (FileUpload_Report.HasFile)/*Fails always*/
  {
      FileInfo fileInfo = new FileInfo(FileUpload_Report.FileName);
      // First add the report to get the ID.
      ReportRepository.Add(report);
      // Then update with the created filepath.
      report.FilePath = PathRoot + @"/" + GetFilename(report) + fileInfo.Extension;
      // Update the old report with a deleteddate.
      ReportRepository.Update(oldReport);
      ReportRepository.Update(report);
      FileUpload_Report.SaveAs(Server.MapPath(PathRoot) + "\\" + GetFilename(report) + fileInfo.Extension);
  }
  </code></pre>
  
  <p>Please help.</p>