Solved

ASP FileUpload Control Upload Simple Status Message

Posted on 2010-09-07
4
775 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now