title: Calling an ASP.NET FileUpload function in code behind with jquery
body: <p>I'm using the ASP.NET FileUpload control. </p>
  
  <p>To upload a file, a user must:</p>
  
  <ol>
  <li>Browse to select a file from his/her device, </li>
  <li>Click the upload button to upload the file to the server.</li>
  </ol>
  
  <p>Is it possible to skip step 2 (the Upload button) and call the 'uploadFile_Click' function on the server through a jquery (postback) once a file is selected? I'm trying the following method but I need some help to finalize it.</p>
  
  <p>ASPX PAGE</p>
  
  <pre><code>&lt;asp:FileUpload runat="server" ID="UploadImages" /&gt;
  &lt;asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="UploadImages" ClientValidationFunction="ValidateUpload" /&gt;
  </code></pre>
  
  <p>CODE BEHIND</p>
  
  <pre><code>protected void uploadFile_Click(object sender, EventArgs e)
  {
  // Upload code
  }
  </code></pre>
  
  <p>JQUERY</p>
  
  <pre><code>function ValidateUpload() {
  var FileUpload_function = document.getElementById('UploadImages');
  
          if (FileUpload_function.value == '') {
              return false;
          }
          else {
  
             ** Here I want to trigger a postback to call the uploadFile_Click. Is that possible? **
          }
          return true;
  
      }
  </code></pre>