title: call fileUpload control using asp button
body: <p>I am creating an application that will show an image when I click a button and browse on the dialog.</p>
  
  <p>this is my sample layout and code:</p>
  
  <pre><code>+---------------------------------------------------+
  |                                                   |
  |                                                   |
  |                                                   |
  |          CLICK HERE TO INSERT IMAGE               |
  |                                                   |
  |                                                   |
  |                                                   |
  +---------------------------------------------------+
  
  &lt;asp:Panel ID="Panel2" runat="server" cssClass="containment-wrapper" style="border:1px solid #000000;"&gt;
              &lt;asp:FileUpload ID="FileUpload1" runat="server" style="display:none;"/&gt;
              &lt;asp:ImageButton ID="MainImage" runat="server" CssClass="mainImage" ImageUrl="~/Image/ClickHere.png" OnClick="MainImage_Click"/&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>and my .CS file</p>
  
  <pre><code>  protected void Page_Load(object sender, EventArgs e)
      {
          MainImage.Attributes.Add("onclick", "document.getElementById('" + FileUpload1.ClientID + "').click();");
  
      }
     protected void MainImage_Click(object sender, ImageClickEventArgs e)
      {
  
      }
  </code></pre>
  
  <p>I can click the "CLICK HERE TO INSERT IMAGE" and shows the file dialog, but my problem is how to get the selected image and show it on the buttonImage.</p>