title: Call hidden FileUpload control on click event
body: <p>I have a <code>FileUpload</code> control on my asp.net page which is hidden</p>
  
  <pre><code>&lt;asp:FileUpload id="FileUploadControl" runat="server" CssClass="hidden" /&gt;
  </code></pre>
  
  <p>I want this control to be called when user clicks the <code>Browse</code> button</p>
  
  <pre><code>&lt;asp:Button runat="server" id="BrowseButton" text="browse" /&gt;
  </code></pre>
  
  <p>Is it possible to give control to the <code>FileUpload</code> control everytime user clicks the <code>browse</code> button?</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>On <code>BrowseButton_Click</code> event I want to get upload the file</p>
  
  <pre><code> protected void BrowseButton_Click(object sender, EventArgs e)
          {
              if (FileUploadControl.HasFile)
              {
                  try
                  {
                      string filename = Path.GetFileName(FileUploadControl.FileName);
                      FileUploadControl.SaveAs(Server.MapPath("~/") + filename);
                      Response.Write("&lt;script&gt;alert('done');&lt;/script&gt;");
                  }
                  catch (Exception ex)
                  {
                      Response.Write(ex.Message);
                  }
  
              }
              else
              {
                  Response.Write("&lt;script&gt;alert('please choose');&lt;/script&gt;");
              }
          }
  </code></pre>