Solved

ASP FileUpload Control Upload Simple Status Message

Posted on 2010-09-07
4
777 Views
Last Modified: 2012-05-10
Hi All,

I have 3 standard ASP.Net FileUpload controls of which I check and upload any files that have been selected within 1 button OnClick event.

I have seen various upload progress bar solutions including AJAX that provide feedback on how long you have left etc.. but all I want is to be able to display a simple message stating that an upload is in progress and then for that message to disappear when the upload has been completed.

Can anyone share code with me that would achieve this in it's simplest form as I am being pushed for time by my client i'm afraid.

I would have though that I could execute code before the first file upload that would display a message and then execute another piece of code after the 3rd upload, to hide the message. But this doesn't work.

Many thanks in advance,

Rit


protected void btnUpload_Click(object sender, ImageClickEventArgs e)
{
if (FileUpload1.HasFile)
{
   //Upload stuff
}
if (FileUpload2.HasFile)
{
   //Upload stuff
}
if (FileUpload3.HasFile)
{
   //Upload stuff
}
}

Open in new window

0
Comment
Question by:rito1
4 Comments
 
LVL 11

Accepted Solution

by:
G0ggy earned 167 total points
ID: 33618639
No it a message won't display as the entire process is completed before control is passed back to the display. Without dipping into threading, which reading your time constraints I guess you do not want to do, the simplest option would be to attach a piece of jQuery code to the button, showing an upload message when it is clicked, then response the server side code at the end of the upload, you could then detect this with more jQuery or in the page load event.

Hope you get what I'm suggesting, if not post back.
0
 
LVL 3

Assisted Solution

by:DanMerk
DanMerk earned 166 total points
ID: 33618759
To get around threading, you could open a new window that displays the progress of the download. Then, set up a very basic server side program that checks periodically, and when needed, update the window with the progress of the download. Not super elegant, but it should work.
0
 
LVL 3

Assisted Solution

by:vusov
vusov earned 167 total points
ID: 33619874
You can use AsyncFileUpload from the ASP.NET AJAX Toolkit. I've uploaded the example, please  review.
Also you can review the example here http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx
WebApplication5.zip
0
 
LVL 1

Author Closing Comment

by:rito1
ID: 33626781
Thank all, I will  look into all 3 options.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question