Click here to Skip to main content
16,019,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a page with a button meant to process a file and it takes sometime to finish. To be more user friendly, I want to add a "loading, please wait" page so that the user is aware that the event is being processed. how can I do that in ASP?

Cheers,
Posted

1 solution

1. You can do that using AJAX server controls like UpdatePanel and UpdateProgress. You will also need to move your file processing inside the updatepanel so that it will also happen asynchronously and letting the user see you message.

check this to find details:
AJAX for Beginners (Part 1) - Understanding ASP.NET AJAX Server Controls[^]
 
Share this answer
 
Comments
Mabchour 1989 20-Jun-12 5:13am    
I tried it now and it's exactly what I want, However I have a small problem: since my page consist of a FileUpload and ImageButton, when i click on the img button the app can't read the file path in the FileUpload textbox, it seems like it's deleted once the button clicked, I tried to put the fileupload control inside and outside the contenttemplate in the updatepanel but the same error happens. Any idea how to solve that?
Rahul Rajat Singh 20-Jun-12 5:18am    
so what i understood from the question

1. you have fileuplod inside updatepanel.
2. you click the upload button and file is perhaps uploaded.
3. now you click on image button.
4. since the file of upload control is gone you cant access it now.

I hope i got it right. if that is the case then when you are uploading the file you can save this value of fileupload control in some session/cache variable. and later when you hit the imagebutton control dont use fileupload control but use the value from session/cache.

I hope this will solve your problem and you will get to do what you want.
Mabchour 1989 20-Jun-12 5:29am    
That's practically impossible in my case because i have a function that processes a file and access 10 other classes and their functions in order to perform the processing. that main function takes the FileUpload control itself and i tried to pass it to a session variable but it didn't work, also i tried to pass the filepath itself to the fileupload before using it in the function but the filename is read-only.
Rahul Rajat Singh 20-Jun-12 5:34am    
ok. but tell me this. what is it that the imagebutton wants from the fileupload control. is it only the value of the filepath it contains. if yes than that can be done using hidden fields too. The only catch then would be to have the hidden field inside the updatepanel too.
Mabchour 1989 20-Jun-12 5:48am    
Here is what happens.

- The user uses the fileupload control to choose a data file.
- he clicks then on the image button.
- lot of time in processing goes on.
- if processing is successful, the app is redirected to a new web page in which other stuff go on.
- otherwise, the app redirects to an error page.

I can't have any hidden fields, it has to be a FileUpload control because I pass it to all other classes, otherwise I'll need to rewrite all my 2-months code which is impossible due to time constraints.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900