how to upload an image file without any postback in ASP.NET
<p>I am uploading a file using the <code>&lt;asp:FileUpload&gt;</code> and <code>&lt;asp:button&gt;</code> controls but I want to do it without a postback. On button click I execute the following code.  </p>

<pre><code>protected void btnUpload_Click(object sender, EventArgs e)
{
    string strFileName = Path.GetFileName(FileUpload1.FileName);  //fileupload1 is the &lt;asp:fileupload ID
    FileUpload1.SaveAs(Server.MapPath("~/UploadFile/" + strFileName + ""));
    imgUpload.ImageUrl = "../UploadFile/" + strFileName + "";  //imgupload is the &lt;img ID on which I am showing the image after upload
    imgUpload.Visible = true;
}
</code></pre>

<p>After uploading the file I am showing the saved image from the specified folder in my project solution, but on clicking the upload button the whole page gets loaded and I don't want the postback on clicking the upload button.</p>
