Click here to Skip to main content
13,597,584 members
Click here to Skip to main content
Add your own
alternative version


12 bookmarked
Posted 11 Oct 2012
Licenced CPOL

Showing File Upload Progress to the user using UpdatePanel control in ASP.NET

, 17 Dec 2012
Rate this:
Please Sign up or sign in to vote.
This article describes the working of fileupload inside an updatepanel and showing the file upload progress to the user.


This article describes the working of FileUpload inside an UpdatePanel and showing the file UploadProgress to the user.


AJAX is a playing an important role in ASP.NET developers world, in terms of user experience and responsiveness. There are many scenarios when we have to use FileUpload in a page which have no postbacks. This article describes the working of FileUpload inside an UpdatePanel with UpdateProgress.

The problem is that the FileUpload control does not work with asynchronous postbacks, and therefore does not work from within an AJAX UpdatePanel. This article allows the FileUpload control to work within an UpdatePanel. The example will be a simple web page containing a FileUpload, Image control, Updatepanel, Updateprogress, and a button. We will see that the FileUpload will function inside an UpdatePanel with UpdateProgress.

Using the code

So as per our requirements, we are trying to user file upload control to perform a full postback, and we do this using triggers. Triggers allow the developer to specify what will cause partial and full postbacks. They must be defined within the UpdatePanel but outside of the ContentTemplate. We want to create a trigger that will instruct the button that we are using for the upload to perform a full postback. The updated markup is:

protected void Button1_Click(object sender, EventArgs e)
    Label1.Text = "Data Processed Successfully";

protected void Upload_Click(object sender, EventArgs e)
    if (FU1.HasFile)
        FU1.SaveAs(MapPath("~/Image/" + FU1.FileName));
        System.Drawing.Image img1 = System.Drawing.Image.FromFile(
                         MapPath("~/image/") + FU1.FileName);
        ImageView.ImageUrl = "~/Image/" + FU1.FileName;

Now when we click on upload button, The uploaded image will be viewed without having asynchronous postback. After clicking on final submission UpdateProgress will get active and show an processing image and the data get ready for the finalization.

Point of interest 

In this article we saw how we can put a FileUpload control inside an UpdatePanel to provide the feedback to the user that the file is being uploaded. This is fairly known to a lot of developers but people new to development will find it useful.


11 October 2012: First version. 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
India India
I am a Software Engineer from Bhopal. I started my Career from Programming in ASP and now working as a Web Developer in ASP.Net (C#). I Love coding and always ready to gain new thing and always been towards Microsoft Technologies. Apart from coding my other hobbies are traveling, Internet Surfing, spending time with family and hang out with friends.

You may also be interested in...


Comments and Discussions

QuestionMessage Closed Pin
26-Oct-12 21:23
memberMember 382310126-Oct-12 21:23 
AnswerRe: nice one very nice Pin
AshishChaudha16-Dec-12 22:11
memberAshishChaudha16-Dec-12 22:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.180621.3 | Last Updated 17 Dec 2012
Article Copyright 2012 by AshishChaudha
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid