Solved

Gif Downloading while Process are in execution

Posted on 2009-03-31
3
230 Views
Last Modified: 2013-11-11
Hi:

I need to show a gif with the leyend "Please Wait: Downloading"; this when the user push a buttom a file is processes. I have the next JavaScript to show and hide a <div></div> where the gif is (the Image Control is used here).

To show the <div> works fine but when the process is over I need to hide again the <div>

What I can do? I have the next line in the Finally part, but doesn't works:
Finally
'Response.Write("javascript: cerrar();")
End Try

Solutions please


All this is in ASP.NET with framework 1.0... yes I know is old version but that was that the client paid.



////////////////////////////////In the Html
 
<script language="JavaScript">
				function mostrardiv() 
				{
					div = document.getElementById('crazy');
					div.style.display = '';
				}
				function cerrar() 
				{
					div = document.getElementById('crazy');
					div.style.display='none';
				}		
		</script>
 
 
///////////////////////////// I show the <DIV> where the downloading.gif is//////////////////
<form id="Form1" method="post" runat="server" onsubmit="return mostrardiv();">

Open in new window

0
Comment
Question by:777999
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 250 total points
ID: 24033332
I do not see why you would need to call that cerrar() function because after submit is the page reloaded anyway with the state defined in the html page.

But anyway, you can use the fact that no user interface is updated while havy processing is done like form submit and file upload.
So you could call that cerrar() function immediately and it will be seen after upload finish.
Like this:

                        function mostrardiv()
                        {
                              div = document.getElementById('crazy');
                              div.style.display = '';
                                                                                setTimeout(cerrar, 1700);
                        }
0
 

Author Comment

by:777999
ID: 24041060
Zvonko:

Thank you so much. You have reason I am using a FileUpload, that's the reason why I need the hide the gif. You have your points :)

There are another way to calculate the time of upload and show the gif in the proportional Time?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 24041337
You closed this Question before I have seen it.
Do you need more support? Why did you grade with the grade B?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

813 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