title: Upload file control not showing any file in the code behind
body: <p>I have a very simple application. I am trying to upload the file using File upload control of ASP.net. Below is my entire .cs code and .aspx code:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace TestFileUpload1
  {
      public partial class WebForm1 : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
  
          }
  
          protected void uploadFile_Click(object sender, EventArgs e)
          {
  
              if (UploadImages.HasFiles)
              {
                  foreach (HttpPostedFile uploadedFile in UploadImages.PostedFiles)
                  {
                      uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath(&quot;~/Images/&quot;), uploadedFile.FileName));
                      //listofuploadedfiles.Text += String.Format(&quot;{0}&lt;br /&gt;&quot;, uploadedFile.FileName);
                  }
              }
          }
      }
  }
  </code></pre>
  <p>My .aspx code:</p>
  <pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;WebForm1.aspx.cs&quot; Inherits=&quot;TestFileUpload1.WebForm1&quot; %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head runat=&quot;server&quot;&gt;
      &lt;title&gt;Test web site&lt;/title&gt;
         &lt;script src=&quot;Scripts/jquery-1.11.0.js&quot;&gt;&lt;/script&gt;
  
    &lt;script src=&quot;Scripts/jquery.mobile-1.4.5.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
          &lt;div&gt;
                &lt;div&gt;
               &lt;asp:FileUpload runat=&quot;server&quot; ID=&quot;UploadImages&quot; AllowMultiple=&quot;true&quot; /&gt;  
              &lt;asp:Button runat=&quot;server&quot; ID=&quot;uploadedFile&quot; Text=&quot;Upload&quot; OnClick=&quot;uploadFile_Click&quot; /&gt;  
               &lt;asp:Label ID=&quot;listofuploadedfiles&quot; runat=&quot;server&quot; /&gt;  
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>whenever I try to upload a file, I get &quot;False&quot; for  UploadImages.HasFiles.
  Above is full working example.
  As soon as I remove one of these script tags :</p>
  <pre><code> &lt;script src=&quot;Scripts/jquery-1.11.0.js&quot;&gt;&lt;/script&gt;
  
    &lt;script src=&quot;Scripts/jquery.mobile-1.4.5.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>my code starts working and I get &quot;true&quot; for UploadImages.HasFiles when I try to upload a file.</p>
  <p>I am using .net framework 4.7.2</p>
  <p>I need to keep these two script tags in my code because of the GUI and this is an old application where these tags are used in all the pages.</p>
  <p>I also tried to wrap the control in a update panel and that didn't work either. below is the changed .aspx page. although, I want my original code to work. I don't want to use ajax, but I just tried to use it because it is suggested as one of the solution</p>
  <pre><code>  &lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;WebForm1.aspx.cs&quot; Inherits=&quot;TestFileUpload1.WebForm1&quot; %&gt;
  &lt;%--&lt;%@ Register Assembly=&quot;AjaxControlToolkit&quot; Namespace=&quot;AjaxControlToolkit&quot;  TagPrefix=&quot;asp&quot;%&gt;--%&gt;
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;head runat=&quot;server&quot;&gt;
      &lt;title&gt;Test web site&lt;/title&gt;
         &lt;script src=&quot;Scripts/jquery-1.11.0.js&quot;&gt;&lt;/script&gt;
  
    &lt;script src=&quot;Scripts/jquery.mobile-1.4.5.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
          &lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot;&gt;&lt;/asp:ScriptManager&gt;
          &lt;div&gt;
                &lt;div&gt;
                    &lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&gt;
                          &lt;ContentTemplate&gt;
                              &lt;asp:FileUpload runat=&quot;server&quot; ID=&quot;UploadImages&quot; AllowMultiple=&quot;true&quot; /&gt;
                          &lt;/ContentTemplate&gt;
                         &lt;Triggers&gt;
                             &lt;asp:PostBackTrigger ControlID=&quot;uploadedFile&quot; /&gt;
                          &lt;/Triggers&gt;
                        
                        &lt;/asp:UpdatePanel&gt;
                &lt;asp:Button runat=&quot;server&quot; ID=&quot;uploadedFile&quot; Text=&quot;Upload&quot; OnClick=&quot;uploadFile_Click&quot; /&gt;
               &lt;asp:Label ID=&quot;listofuploadedfiles&quot; runat=&quot;server&quot; /&gt;  
                        
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>below is the image of false value that I am getting in code behind:</p>
  <p><a href="https://i.stack.imgur.com/oy4Zi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oy4Zi.png" alt="enter image description here" /></a></p>
  <p>Any help will be highly appreciated.</p>