Solved

ASP FileUpload Control Upload Simple Status Message

Posted on 2010-09-07
4
772 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank all, I will  look into all 3 options.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

11 Experts available now in Live!

Get 1:1 Help Now