[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

ASP FileUpload Control Upload Simple Status Message

Posted on 2010-09-07
4
Medium Priority
?
787 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Accepted Solution

by:
G0ggy earned 668 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 664 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 668 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 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