Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How to Clear the Flushed .gif / message


Message #1 by cherryxchang@h... on Thu, 5 Dec 2002 18:06:49
Hi,

I am trying to add an animation to an ASP page. The page is
OrderProcess.asp. The reason to add the animation is the OrderProcess.asp 
will take several mins., especially for a big order. I want to inform user 
that order is processing. Sometimes, user waits for a while, will close 
window or press Back. I want to show it as long as the OrderProcess.asp
started, and will redirect to another page (OrderConfirm.asp) when the
processing is done. 

Here's some pseudo code for an ASP processing page:

<%Option Explicit
Response.Buffer=true
Response.Write "<img src='pleasewait.gif'>"
Response.Flush	' Sends html without waiting until done
Call DoProcessing()
Server.Transfer "AllDone.asp"
Response.End

My problem is when I get to AllDone.asp, the pleaseWait.gif is still 
there. How can I clear PleaseWait.gif on AllDone.asp? In other words, how 
can I clear the flushed message?

Thanks for your help.

Cherry 

Message #2 by Imar@S... on Thu, 5 Dec 2002 22:07:47
Hi there,

Maybe you can use some DHTML to display and hide the image:

Something like this may work:

    Response.Write "<img src='pleasewait.gif' id=""imgWait"" 
style=""display:inline;"">"

This will add a style definition telling the image to be visible as an 
inline element. SO far nothing new, because it was already visible.

Now right after your DoProcessing() method, add some JavaScript to hide 
the image:

    Response.Write(<"script type=""text/javascript"">" & vbCrLf)
    Response.Write(<"document.getElementById(""imgWait"").style.display 
= 'none';" & vbCrLf)
    Response.Write("</script>")

This will hide the image in the page by setting its display property to 
none.

Alternativey, you can use Response.Redirect instead of Server.Transfer. 
Response.Redirect tells the browser to request a new page, so once that 
gets loaded the old one (with the image) will be completely gone.

HtH

Imar


> Hi,

> I am trying to add an animation to an ASP page. The page is
O> rderProcess.asp. The reason to add the animation is the 
OrderProcess.asp 
w> ill take several mins., especially for a big order. I want to inform 
user 
t> hat order is processing. Sometimes, user waits for a while, will close 
w> indow or press Back. I want to show it as long as the OrderProcess.asp
s> tarted, and will redirect to another page (OrderConfirm.asp) when the
p> rocessing is done. 

> Here's some pseudo code for an ASP processing page:

> <%Option Explicit
R> esponse.Buffer=true
R> esponse.Write "<img src='pleasewait.gif'>"
R> esponse.Flush	' Sends html without waiting until done
C> all DoProcessing()
S> erver.Transfer "AllDone.asp"
R> esponse.End

> My problem is when I get to AllDone.asp, the pleaseWait.gif is still 
t> here. How can I clear PleaseWait.gif on AllDone.asp? In other words, 
how 
c> an I clear the flushed message?

> Thanks for your help.

> Cherry 

Message #3 by cherryxchang@h... on Thu, 5 Dec 2002 22:15:24
Hi Imar,

Thank you so much! I'll give a try.

Cherry


> Hi there,

> Maybe you can use some DHTML to display and hide the image:

> Something like this may work:

>     Response.Write "<img src='pleasewait.gif' id=""imgWait"" 
s> tyle=""display:inline;"">"

> This will add a style definition telling the image to be visible as an 
i> nline element. SO far nothing new, because it was already visible.

> Now right after your DoProcessing() method, add some JavaScript to hide 
t> he image:

>     Response.Write(<"script type=""text/javascript"">" & vbCrLf)
 >    Response.Write(<"document.getElementById(""imgWait"").style.display 
=>  'none';" & vbCrLf)
 >    Response.Write("</script>")

> This will hide the image in the page by setting its display property to 
n> one.

> Alternativey, you can use Response.Redirect instead of Server.Transfer. 
R> esponse.Redirect tells the browser to request a new page, so once that 
g> ets loaded the old one (with the image) will be completely gone.

> HtH

> Imar

> 
>>  Hi,

> > I am trying to add an animation to an ASP page. The page is
O> > rderProcess.asp. The reason to add the animation is the 
O> rderProcess.asp 
w> > ill take several mins., especially for a big order. I want to inform 
u> ser 
t> > hat order is processing. Sometimes, user waits for a while, will 
close 
w> > indow or press Back. I want to show it as long as the OrderProcess.asp
s> > tarted, and will redirect to another page (OrderConfirm.asp) when the
p> > rocessing is done. 

> > Here's some pseudo code for an ASP processing page:

> > <%Option Explicit
R> > esponse.Buffer=true
R> > esponse.Write "<img src='pleasewait.gif'>"
R> > esponse.Flush	' Sends html without waiting until done
C> > all DoProcessing()
S> > erver.Transfer "AllDone.asp"
R> > esponse.End

> > My problem is when I get to AllDone.asp, the pleaseWait.gif is still 
t> > here. How can I clear PleaseWait.gif on AllDone.asp? In other words, 
h> ow 
c> > an I clear the flushed message?

> > Thanks for your help.

> > Cherry 

Message #4 by "Craig Flannigan" <ckf@k...> on Fri, 6 Dec 2002 11:40:11 -0000
Server.Transfer simply adds the ASP code in "Alldone.asp" to the end of the
page that called it, so your image will remain like you stated.

Could you not replace it with Response.Redirect "AllDone.asp" ?
At least that way it's a new page that's loaded.




-----Original Message-----
From: cherryxchang@h... [mailto:cherryxchang@h...]
Sent: 05 December 2002 18:07
To: ASP Web HowTo
Subject: [asp_web_howto] How to Clear the Flushed .gif / message


Hi,

I am trying to add an animation to an ASP page. The page is
OrderProcess.asp. The reason to add the animation is the OrderProcess.asp
will take several mins., especially for a big order. I want to inform user
that order is processing. Sometimes, user waits for a while, will close
window or press Back. I want to show it as long as the OrderProcess.asp
started, and will redirect to another page (OrderConfirm.asp) when the
processing is done.

Here's some pseudo code for an ASP processing page:

<%Option Explicit
Response.Buffer=true
Response.Write "<img src='pleasewait.gif'>"
Response.Flush	' Sends html without waiting until done
Call DoProcessing()
Server.Transfer "AllDone.asp"
Response.End

My problem is when I get to AllDone.asp, the pleaseWait.gif is still
there. How can I clear PleaseWait.gif on AllDone.asp? In other words, how
can I clear the flushed message?

Thanks for your help.

Cherry


_____________________________________________________________________
Please contact I.T. Support if you have received this email in error.
This e-mail has been scanned for all viruses by Star Internet.
_____________________________________________________________________


_____________________________________________________________________
Kingfield Heath Ltd. Email Disclaimer

Confidentiality : This email and its attachments are intended for the
above-named only and may be confidential. If they have come to you in
error you must take no action based on them, nor must you copy or
show them to anyone; please reply to this email and highlight the
error.

Security Warning : Please note that this email has been created in
the knowledge that the internet is not a 100% secure communications
medium. We advise that you understand and observe this lack of
security when emailing us.

Viruses : Although we have taken steps to ensure that this email and
attachments are free from any virus, we advise that, in keeping with
good computing practice, the recipient should ensure they are
actually virus free.
_____________________________________________________________________
Message #5 by cherryxchang@h... on Sat, 7 Dec 2002 06:16:48
Hi Craig,

Thank you! Actually I tried use Response.Redirect "AllDone.asp" first, 
but it didn't work, because of Flush. I can't give up Flush, so I tried 
Server.Transfer. I have to say using Response.Redirect is my solution. It 
works now. I used a little JavaScript to redirect. 

Thank you all for your help!

Cherry

  Return to Index