Solved

Gif Downloading while Process are in execution

Posted on 2009-03-31
3
225 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
validation, if text area is typed or pasted into 2 25
alert before form submission 6 27
Polygon I google maps 1 14
Objects on Same Line 2 16
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
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 video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

932 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

12 Experts available now in Live!

Get 1:1 Help Now