title: ASP.net FileUploader Control - click using jQuery
body: <p>I'm using a FileUpload control in ASP.net. Formatting input buttons is such a pain that I'm trying to work around by using a simple (formatted) button to activate a jQuery function that clicks the FileUpload control. Here is my formatted button, called btn_upload_FILE:</p>
  
  <pre><code>&lt;asp:Button ID="btn_upload_FILE" runat="server" class="c_button" Text="Import an EDD" OnClick="Main" /&gt;
  </code></pre>
  
  <p>Here's the FileUpload control:</p>
  
  <pre><code>&lt;asp:FileUpload runat="server" ID="FILE_uploader"&gt;&lt;/asp:FileUpload&gt; 
  </code></pre>
  
  <p>And here's the jQuery:</p>
  
  <pre><code>$('#&lt;%= btn_upload_FILE.ClientID %&gt;').click(function () {
       $('#&lt;%= FILE_uploader.ClientID %&gt;').click();
  });
  </code></pre>
  
  <p>Super-simple, and it works great, it opens a file browser and lets me select a file. </p>
  
  <p>The problem is that, even through the FileUpload control appears to be working, the file I select isn't actually loaded into the FileUpload control, so my code-behind can't see it. It <i>looks</i> like it's working, but the FileUpload ends up empty. The FileUpload's .change event is not fired, so I know nothing is happening. If I just press the FileUpload control's button, it works fine.</p>
  
  <p>Can anyone tell me why the FileUpload isn't receiving a file, even though I can browse with it? Any help is, as always, appreciated.</p>