title: FileUpload.HasFile properties is not within UpdatePanel but still alway return false
body: <p>I face this problem for a few day, after searching on google is still not help. Anyone help fix it. my fileupload control is not placed in updatepanel but it' hasFile properties still alway return false.</p>
  
  <p>Here is my code </p>
  
  <pre><code>&lt;table style="width: 100%;"&gt;
      &lt;tr&gt;
          &lt;td style="width: 200px;"&gt;
              Name
          &lt;/td&gt;
          &lt;td style="vertical-align: top;"&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtName" runat="server" Width="500px" CssClass="text01" /&gt;
              &lt;/div&gt;
              &lt;div style="float: left; padding: 2px 0 0 5px;"&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="error01"
                      ErrorMessage="This field is required !" Display="Dynamic" ControlToValidate="txtName"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="width: 200px;"&gt;
              Position
          &lt;/td&gt;
          &lt;td style="vertical-align: top;"&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtPosition" runat="server" Width="500px" CssClass="text01" /&gt;
              &lt;/div&gt;
              &lt;div style="float: left; padding: 2px 0 0 5px;"&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="error01"
                      ErrorMessage="This field is required !" Display="Dynamic" ControlToValidate="txtPosition"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              Vietnamese Position
          &lt;/td&gt;
          &lt;td&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtPositionVN" runat="server" Width="500px" CssClass="text01" /&gt;
              &lt;/div&gt;
              &lt;div style="float: left; padding: 2px 0 0 5px;"&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="error01"
                      ErrorMessage="This field is required !" Display="Dynamic" ControlToValidate="txtPositionVN"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;
              Order
          &lt;/td&gt;
          &lt;td&gt;
              &lt;asp:DropDownList ID="ddlOrder" runat="server" Height="16px" Width="150px"&gt;
              &lt;/asp:DropDownList&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="width: 200px;"&gt;
              Email
          &lt;/td&gt;
          &lt;td style="vertical-align: top;"&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtEmail" runat="server" Width="500px" CssClass="text01" /&gt;
              &lt;/div&gt;
              &lt;div style="float: left; padding: 2px 0 0 5px;"&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" CssClass="error01"
                      ErrorMessage="This field is required !" Display="Dynamic" ControlToValidate="txtEmail"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
              &lt;asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                  ControlToValidate="txtEmail" CssClass="text01" Display="Dynamic" 
                  ErrorMessage="Input valid email address !" 
                  ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"&gt;&lt;/asp:RegularExpressionValidator&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="width: 200px;"&gt;
              Mobile Phone Number
          &lt;/td&gt;
          &lt;td style="vertical-align: top;"&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtPhone" runat="server" Width="500px" CssClass="text01" /&gt;
              &lt;/div&gt;
              &lt;div style="float: left; padding: 2px 0 0 5px;"&gt;
                  &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="error01"
                      ErrorMessage="This field is required !" Display="Dynamic" ControlToValidate="txtPhone"&gt;&lt;/asp:RequiredFieldValidator&gt;
              &lt;/div&gt;
              &lt;asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                  ControlToValidate="txtPhone" CssClass="text01" Display="Dynamic" 
                  ErrorMessage="Input valid mobile phone number !" ValidationExpression="^\d+$"&gt;&lt;/asp:RegularExpressionValidator&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="width: 200px;vertical-align: top;"&gt;
              Address
          &lt;/td&gt;
          &lt;td style="vertical-align: top;"&gt;
              &lt;div style="float: left;"&gt;
                  &lt;asp:TextBox ID="txtAdd" runat="server" Width="500px" CssClass="text01" TextMode="MultiLine" Height="200px" /&gt;
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td style="vertical-align: top;"&gt;
              Image
          &lt;/td&gt;
          &lt;td valign="top"&gt;
              &lt;asp:FileUpload ID="fupImage" runat="server" CssClass="text01" Width="400px" /&gt;
              &lt;asp:Image ID="imgURL" runat="server" Width="100px" Height="100px" Visible="false" /&gt;
              &lt;asp:Label ID="lblMessageForfupImage" runat="server" ForeColor="Red" Visible="false"&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td /&gt;
          &lt;td&gt;
              &lt;asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" CssClass="text01" /&gt;
              &lt;asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click"
                  CssClass="text01" Visible="False" /&gt;
              &lt;asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" 
                  CssClass="text01" CausesValidation="False" /&gt;
              &lt;asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click"
                  CssClass="text01" Height="22px" CausesValidation="False" /&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And Code Behind :</p>
  
  <pre><code>if (fupImage.PostedFile.FileName != "")
          {
              if (!Utitlties.Instance.CheckImageFileType(fupImage.PostedFile.FileName))
              {
                  lblMessageForfupImage.Visible = true;
                  lblMessageForfupImage.Text = "Image file only accept *.jpg, *.png, *.bmp, *.gif Extensions !";
                  fupImage.Focus();
              }
              else
              {
                  evt.ImageURL = Utils.Instance.SaveImage(fupImage.PostedFile.InputStream, fupImage.PostedFile.FileName, true);
                  UniqueDesign.Utilities.Utitlties.Instance.DeleteFile(imgURL.ImageUrl);
              }
          }
  </code></pre>
  
  <p>when i debbuged it, it's HasFile properties return alway is false, and</p>
  
  <p>fupImage.PostedFile.ContentLength = -2 but it still got filename and filetype.</p>
  
  <p>And here is my web.config :</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>Asp.Net Configuration option in Visual Studio.
          A full list of settings and comments can be found in 
          machine.config.comments usually located in 
          \Windows\Microsoft.Net\Framework\vx.x\Config 
  -->
  
      
          
          
              
                  
                  
                      
                      
                      
                      
                  
              
          
      
      
      </p>
  
  <pre><code>&lt;/appSettings&gt;
  &lt;connectionStrings/&gt;
  &lt;!--&lt;location path="admin_ServicesPhotosManager.aspx"&gt;
      &lt;system.web&gt;
          &lt;httpRuntime executionTimeout="3600" maxRequestLength="40960" useFullyQualifiedRedirectUrl="false"/&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;--&gt;
  &lt;system.web&gt;
      &lt;httpRuntime executionTimeout="3600"
                               maxRequestLength="40960"
                               minFreeThreads="8"
                               minLocalRequestFreeThreads="4"
                               appRequestQueueLimit="5000"
                               enableKernelOutputCache="true"
                               enableVersionHeader="true"
                               requireRootedSaveAsPath="true"
                               enable="true"
                               shutdownTimeout="90"
                               delayNotificationTimeout="5"
                               waitChangeNotification="0"
                               maxWaitChangeNotification="0"
                               enableHeaderChecking="true"
                               sendCacheControlHeader="true"
                               apartmentThreading="false"/&gt;
      &lt;!-- 
                      Set compilation debug="true" to insert debugging 
                      symbols into the compiled page. Because this 
                      affects performance, set this value to true only 
                      during development.
              --&gt;
      &lt;compilation debug="true"&gt;
          &lt;assemblies&gt;
              &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
              &lt;add assembly="FileUploadLibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=AF961ECE0B692DFB"/&gt;
          &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;!--
                      The &lt;authentication&gt; section enables configuration 
                      of the security authentication mode used by 
                      ASP.NET to identify an incoming user. 
              --&gt;
      &lt;authentication mode="Windows"/&gt;
      &lt;!--
                      The &lt;customErrors&gt; section enables configuration 
                      of what to do if/when an unhandled error occurs 
                      during the execution of a request. Specifically, 
                      it enables developers to configure html error pages 
                      to be displayed in place of a error stack trace.
  
              &lt;customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"&gt;
                      &lt;error statusCode="403" redirect="NoAccess.htm" /&gt;
                      &lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;
              &lt;/customErrors&gt;
              --&gt;
      &lt;pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never" enableViewStateMac="false"&gt;
          &lt;controls&gt;
              &lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
              &lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;/controls&gt;
      &lt;/pages&gt;
      &lt;httpHandlers&gt;
          &lt;remove verb="*" path="*.asmx"/&gt;
          &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
          &lt;add verb="GET" type="darrenjohnstone.net.FileUpload.UploadProgressHandler, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb" path="UploadProgress.ashx"/&gt;
          &lt;add verb="GET" type="darrenjohnstone.net.FileUpload.SQLFileDownloadHandler, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb" path="DownloadFile.ashx"/&gt;
      &lt;/httpHandlers&gt;
      &lt;httpModules&gt;
          &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add name="upload_module" type="darrenjohnstone.net.FileUpload.UploadModule, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb"/&gt;
      &lt;/httpModules&gt;
  &lt;/system.web&gt;
  &lt;system.codedom&gt;
      &lt;compilers&gt;
          &lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
              &lt;providerOption name="CompilerVersion" value="v3.5"/&gt;
              &lt;providerOption name="WarnAsError" value="false"/&gt;
          &lt;/compiler&gt;
          &lt;compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
              &lt;providerOption name="CompilerVersion" value="v3.5"/&gt;
              &lt;providerOption name="OptionInfer" value="true"/&gt;
              &lt;providerOption name="WarnAsError" value="false"/&gt;
          &lt;/compiler&gt;
      &lt;/compilers&gt;
  &lt;/system.codedom&gt;
  &lt;!-- 
              The system.webServer section is required for running ASP.NET AJAX under Internet
              Information Services 7.0.  It is not necessary for previous version of IIS.
      --&gt;
  &lt;system.webServer&gt;
      &lt;security&gt;
          &lt;requestFiltering&gt;
              &lt;requestLimits maxAllowedContentLength="1073741824"&gt;
              &lt;/requestLimits&gt;
          &lt;/requestFiltering&gt;
      &lt;/security&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
      &lt;modules&gt;
          &lt;remove name="ScriptModule"/&gt;
          &lt;add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;remove name="upload_module" /&gt;
          &lt;add name="upload_module" type="darrenjohnstone.net.FileUpload.UploadModule, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb" /&gt;
      &lt;/modules&gt;
      &lt;handlers&gt;
          &lt;remove name="WebServiceHandlerFactory-Integrated"/&gt;
          &lt;remove name="ScriptHandlerFactory"/&gt;
          &lt;remove name="ScriptHandlerFactoryAppServices"/&gt;
          &lt;remove name="ScriptResource"/&gt;
          &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
          &lt;add name="UploadProgress" verb="GET" type="darrenjohnstone.net.FileUpload.UploadProgressHandler, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb" path="UploadProgress.ashx" /&gt;
          &lt;add name="FileDownload" verb="GET" type="darrenjohnstone.net.FileUpload.SQLFileDownloadHandler, fileuploadlibrary, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af961ece0b692dfb" path="DownloadFile.ashx" /&gt;
      &lt;/handlers&gt;
  &lt;/system.webServer&gt;
  &lt;runtime&gt;
      &lt;assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/&gt;
              &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/&gt;
          &lt;/dependentAssembly&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/&gt;
              &lt;bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/&gt;
          &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <p></p>