Solved

ASP FileUpload Control Upload Simple Status Message

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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