473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Transition Page

Anyone know what I can do to build a transition page while ASP code runs in
the background? Looking for something to say "Please wait while
loading....."
Jul 19 '05 #1
16 2588
Please wait while loading.

<% Response.Flush
'''code that takes a really long time
%>
Thanks for waiting.

Here's some more info. http://www.darkfalz.com/1058/

Ray at work

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
Anyone know what I can do to build a transition page while ASP code runs in the background? Looking for something to say "Please wait while
loading....."

Jul 19 '05 #2
Make sure to put Response.write Space(256) before the Response.flush.
IE has a behaviour (bug?) where it won't display any part of the page
until at least 256 bytes have been sent. Here are three functions you
can use.
' Wait page functions
Sub PrintWaitPageHeader(strHeaderMessage)
Response.write "<html><body>"&vbCrLf
Response.write "<h2>"&strHeaderMessage&"</h2>"&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageStatus(strStatusMessage)
Response.write strStatusMessage&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageComplete(strRedirectURL)
Response.write "<script type="&Chr(34)&"text/javascript"&Chr(34)&">"&vbCrLf
Response.write "document.location.href='"&strRedirectURL&"';"&vbC rLf
Response.write "</script>"&vbCrLf
Response.write "<p>"&Space(256)&vbCrLf
Response.write "<p>If the page does not transfer, <a href="&_
Chr(34)&strRedirectURL&Chr(34)&">click here.</a>"&vbCrLf
Response.write "</body></html>"
Response.Flush
End Sub

Shailesh

Roger Cantillo wrote:
Anyone know what I can do to build a transition page while ASP code runs in
the background? Looking for something to say "Please wait while
loading....."


Jul 19 '05 #3
Will Response.Flush give any trouble when accessing form data via
Request.Form?
"Shailesh Humbad" <hu******@hotmail.com> wrote in message
news:eu**********************@twister.columbus.rr. com...
Make sure to put Response.write Space(256) before the Response.flush.
IE has a behaviour (bug?) where it won't display any part of the page
until at least 256 bytes have been sent. Here are three functions you
can use.
' Wait page functions
Sub PrintWaitPageHeader(strHeaderMessage)
Response.write "<html><body>"&vbCrLf
Response.write "<h2>"&strHeaderMessage&"</h2>"&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageStatus(strStatusMessage)
Response.write strStatusMessage&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageComplete(strRedirectURL)
Response.write "<script type="&Chr(34)&"text/javascript"&Chr(34)&">"&vbCrLf Response.write "document.location.href='"&strRedirectURL&"';"&vbC rLf
Response.write "</script>"&vbCrLf
Response.write "<p>"&Space(256)&vbCrLf
Response.write "<p>If the page does not transfer, <a href="&_
Chr(34)&strRedirectURL&Chr(34)&">click here.</a>"&vbCrLf
Response.write "</body></html>"
Response.Flush
End Sub

Shailesh

Roger Cantillo wrote:
Anyone know what I can do to build a transition page while ASP code runs in the background? Looking for something to say "Please wait while
loading....."

Jul 19 '05 #4
I tried response.flush and it works great. The reason I ask is because I'm
submitting a lot of data via the POST method, and I don't want to lose any
of it. Just being overly cautious.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
What sort of trouble? Have you tried what you want to do to see? You can
response.flush as much as you want, but the request collection will still be there available to you until the point of response.end.

Ray at work

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
Will Response.Flush give any trouble when accessing form data via
Request.Form?


Jul 19 '05 #5
Ah, that's what's testing is for...

<form method="post" action="test.asp">
<input name="x">
<input type="submit">
</form>

<%
response.write request.form("x") & "<hr>"
response.flush
response.write "Request was flushed. Can I still get x?<br>"
response.write request.form("x")
response.end
%>

Ray at work
"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
I tried response.flush and it works great. The reason I ask is because I'm submitting a lot of data via the POST method, and I don't want to lose any
of it. Just being overly cautious.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
What sort of trouble? Have you tried what you want to do to see? You can response.flush as much as you want, but the request collection will
still be
there available to you until the point of response.end.

Ray at work

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
Will Response.Flush give any trouble when accessing form data via
Request.Form?



Jul 19 '05 #6
"Shailesh Humbad" <hu******@hotmail.com> wrote in message
news:eu**********************@twister.columbus.rr. com...
Make sure to put Response.write Space(256) before the Response.flush.
IE has a behaviour (bug?) where it won't display any part of the page
until at least 256 bytes have been sent. Here are three functions you
can use.


Great tip. No wonder I could never make this work before!

-Jon

Jul 19 '05 #7
I asked the same original question a few minutes ago and was referred to
this thread...and it is 90% of what I want. The only problem that I have is
that I want to get rid of the "Please wait message" after the page has
filled. Am I looking at some sort of redirect???

TIA,

Larry Woods

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Ah, that's what's testing is for...

<form method="post" action="test.asp">
<input name="x">
<input type="submit">
</form>

<%
response.write request.form("x") & "<hr>"
response.flush
response.write "Request was flushed. Can I still get x?<br>"
response.write request.form("x")
response.end
%>

Ray at work
"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
I tried response.flush and it works great. The reason I ask is because

I'm
submitting a lot of data via the POST method, and I don't want to lose any
of it. Just being overly cautious.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
What sort of trouble? Have you tried what you want to do to see? You

can response.flush as much as you want, but the request collection will

still
be
there available to you until the point of response.end.

Ray at work

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
> Will Response.Flush give any trouble when accessing form data via
> Request.Form?



Jul 19 '05 #8
Flushing the Response object should have no effect on any part of the
Request object.

I had the transition pages working in Mozilla, but they failed in IE.
So a lot of Google hunting later, I found the tip. I'm glad you like it
too! :)

S.

Roger Cantillo wrote:
Will Response.Flush give any trouble when accessing form data via
Request.Form?
"Shailesh Humbad" <hu******@hotmail.com> wrote in message
news:eu**********************@twister.columbus.rr. com...
Make sure to put Response.write Space(256) before the Response.flush.
IE has a behaviour (bug?) where it won't display any part of the page
until at least 256 bytes have been sent. Here are three functions you
can use.
' Wait page functions
Sub PrintWaitPageHeader(strHeaderMessage)
Response.write "<html><body>"&vbCrLf
Response.write "<h2>"&strHeaderMessage&"</h2>"&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageStatus(strStatusMessage)
Response.write strStatusMessage&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageComplete(strRedirectURL)
Response.write "<script


type="&Chr(34)&"text/javascript"&Chr(34)&">"&vbCrLf
Response.write "document.location.href='"&strRedirectURL&"';"&vbC rLf
Response.write "</script>"&vbCrLf
Response.write "<p>"&Space(256)&vbCrLf
Response.write "<p>If the page does not transfer, <a href="&_
Chr(34)&strRedirectURL&Chr(34)&">click here.</a>"&vbCrLf
Response.write "</body></html>"
Response.Flush
End Sub

Shailesh

Roger Cantillo wrote:

Anyone know what I can do to build a transition page while ASP code runs
in
the background? Looking for something to say "Please wait while
loading....."



Jul 19 '05 #9
Put the message in a div or span tag and give it a unique id, like:
<div id="waitmessage">Please wait...</div>

In the Javascript, replace the line that does the redirect
(location.href=...) with a call to the show/hide functions from here:

http://getelementbyid.com/scripts/index.aspx?CodeID=5

If you want the message to collapse out of the page as well as
disappear, then add a line like:

document.getElementById(id).style.position = "absolute";

to collapse, and if you want to show again, like:

document.getElementById(id).style.position = "relative";

This should work like a charm in most browsers nowadays. There are a
lot of other ways to hide the "please wait" message once the page loads,
but these are more appropriate for a Javascript/HTML forum.

Shailesh
Larry Woods wrote:
I asked the same original question a few minutes ago and was referred to
this thread...and it is 90% of what I want. The only problem that I have is
that I want to get rid of the "Please wait message" after the page has
filled. Am I looking at some sort of redirect???

TIA,

Larry Woods

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Ah, that's what's testing is for...

<form method="post" action="test.asp">
<input name="x">
<input type="submit">
</form>

<%
response.write request.form("x") & "<hr>"
response.flush
response.write "Request was flushed. Can I still get x?<br>"
response.write request.form("x")
response.end
%>

Ray at work
"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
I tried response.flush and it works great. The reason I ask is because


I'm
submitting a lot of data via the POST method, and I don't want to lose
any
of it. Just being overly cautious.
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...

What sort of trouble? Have you tried what you want to do to see? You


can
response.flush as much as you want, but the request collection will


still
be

there available to you until the point of response.end.

Ray at work

"Roger Cantillo" <ro****@axiomsw.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl.. .

>Will Response.Flush give any trouble when accessing form data via
>Request.Form?



Jul 19 '05 #10
Thanks, Ray.

Tried the code but can't get it to work with NS so won't work... Public
site.

Larry

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
Did you look at the darkfalz.com link? You can get rid of it using client
side code and setting the display style. See here.
http://www.darkfalz.com/1058/

Ray at work

"Larry Woods" <la***@lwoods.com> wrote in message
news:ei*************@TK2MSFTNGP12.phx.gbl...
I asked the same original question a few minutes ago and was referred to
this thread...and it is 90% of what I want. The only problem that I
have is
that I want to get rid of the "Please wait message" after the page has
filled. Am I looking at some sort of redirect???

TIA,

Larry Woods


Jul 19 '05 #11
As an interesting addition, you can write intermittent script sections to
the page as the document loads and modify the .value and .display of a
button to display some text (eg. 10%, 20%, 30% etc).

eg.

<%
'Percentage is anything from 0 to 100
Sub WriteProgress(pstrProgress)
Response.Write "<script>"
Response.Write " var pobjButton =
document.getElementById('progressbutton')";
Response.Write " pobjButton.value = '" & pstrProgress & "';"
Response.Write "</script>"
'Make sure this gets sent.
Response.Flush
End Sub

Sub ClearProgress()
Response.Write "<script>"
Response.Write " var pobjButton =
document.getElementById('progressbutton')";
Response.Write " pobjButton.style.display = 'none';"
Response.Write "</script>"
'Make sure this gets sent.
Response.Flush
End Sub
%>

<!-- Add the relevant style properties to change the button to look like
normal text ? -->
<input id="progressbutton" type="button" style="border: 1px solid black;
width: 120px" value="Loading: 0%"/>

<%
'Do some work and repeatedly (eg. a loop):
For i = 1 to 100
WriteProgress "Progress: " & i & "%"
Next
WriteProgress "Progress: Done"
ClearProgress

%>

Of course you can optimise the JavaScript a bit more by using functions
defined at the top of the page etc.

Chris.

"Larry Woods" <la***@lwoods.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks, Ray.

Tried the code but can't get it to work with NS so won't work... Public
site.

Larry

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
Did you look at the darkfalz.com link? You can get rid of it using client
side code and setting the display style. See here.
http://www.darkfalz.com/1058/

Ray at work

"Larry Woods" <la***@lwoods.com> wrote in message
news:ei*************@TK2MSFTNGP12.phx.gbl...
I asked the same original question a few minutes ago and was referred to
this thread...and it is 90% of what I want. The only problem that I
have is
that I want to get rid of the "Please wait message" after the page has
filled. Am I looking at some sort of redirect???

TIA,

Larry Woods



Jul 19 '05 #12
Beware - issuing a response.flush in the middle of <table> structure does
not cause that data to display. The render cannot take place until the
complete table has been sent. Many web pages are a combination of nested
tables, so your technique may not work as you described.

Brian Staff

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
As an interesting addition, you can write intermittent script sections to
the page as the document loads and modify the .value and .display of a
button to display some text (eg. 10%, 20%, 30% etc).

Jul 19 '05 #13
"Larry Woods" <la***@lwoods.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks, Ray.

Tried the code but can't get it to work with NS so won't work... Public site.

Larry


Peter-Paul Koch has written a definitive article on "object detection"
as a methodology for cross-browser support.
http://www.xs4all.nl/~ppk/js/support.html

He also has a DHTML example page that implements object detection to
make text invisible. Cutting and pasting is left as an exercise for the
reader. ;-)
http://www.xs4all.nl/~ppk/js/cross_dhtml.html

HTH
-Chris
Jul 19 '05 #14
OK - for full tables that may be the case (and probably is). I usually work
around that by constructing mini-tables.

I was more aiming this at longish running server-side ASP stuff (eg. 20-30
seconds) where you may want to keep the user informed of the progress and
then move to another page at the end of it.

It's not a proposed solution to the ops post but a side-interest that may
help - the first couple of responses to the ops post were suggesting a
repeated response.write that would result in a new line of text being
appended to the page each time. The scenario that I outline would allow
(with a bit of work) a pseudo-progress bar (moving etc.) to be implemented
(in fact I've done it a few times in just that way).

Cheers,

Chris.

"Brian Staff" <brianstaff@[NoSpam]compuserve.com> wrote in message
news:uT**************@TK2MSFTNGP11.phx.gbl...
Beware - issuing a response.flush in the middle of <table> structure does
not cause that data to display. The render cannot take place until the
complete table has been sent. Many web pages are a combination of nested
tables, so your technique may not work as you described.

Brian Staff

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
As an interesting addition, you can write intermittent script sections to
the page as the document loads and modify the .value and .display of a
button to display some text (eg. 10%, 20%, 30% etc).


Jul 19 '05 #15
I've never experienced this and have used less then 256 bytes....
Is there a particular version that shows this problem or could you give more
info(link) to this?

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Shailesh Humbad" <hu******@hotmail.com> wrote in message
news:eu**********************@twister.columbus.rr. com...
Make sure to put Response.write Space(256) before the Response.flush.
IE has a behaviour (bug?) where it won't display any part of the page
until at least 256 bytes have been sent. Here are three functions you
can use.
' Wait page functions
Sub PrintWaitPageHeader(strHeaderMessage)
Response.write "<html><body>"&vbCrLf
Response.write "<h2>"&strHeaderMessage&"</h2>"&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageStatus(strStatusMessage)
Response.write strStatusMessage&Space(256)&vbCrLf
Response.Flush
End Sub

Sub PrintWaitPageComplete(strRedirectURL)
Response.write "<script type="&Chr(34)&"text/javascript"&Chr(34)&">"&vbCrLf Response.write "document.location.href='"&strRedirectURL&"';"&vbC rLf
Response.write "</script>"&vbCrLf
Response.write "<p>"&Space(256)&vbCrLf
Response.write "<p>If the page does not transfer, <a href="&_
Chr(34)&strRedirectURL&Chr(34)&">click here.</a>"&vbCrLf
Response.write "</body></html>"
Response.Flush
End Sub

Shailesh

Roger Cantillo wrote:
Anyone know what I can do to build a transition page while ASP code runs in the background? Looking for something to say "Please wait while
loading....."

Jul 19 '05 #16
It happened on Windows 2000 Server with I believe IE 5.0 or 5.5 (IIS and
IE running on same machine). It doesn't seem to happen on my Windows XP
Pro/IE 6.0 machine.

Shailesh

Curt_C [MVP] wrote:
I've never experienced this and have used less then 256 bytes....
Is there a particular version that shows this problem or could you give more
info(link) to this?


Jul 19 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard A. DeVenezia | last post by:
I hope this is the end of my present 'discovery' phase. I've learned alot about JavaScript in a short time and my head hurts. The following is what came out of all my questions and all the...
8
by: Workgroups | last post by:
I've got a page where the nature of the beast is such that the user clicks a submit button to ransomize some data in somewhat rapid succession (once per second, give or take). The page generates a...
1
by: Busy | last post by:
Hello Everyone Please can someone point me in the direction of a really good tutorial or discussion on PHP page transition? What I'm looking for is coverage of page transition that covers: ...
1
by: Michel Esber | last post by:
Hello, DB2 V8 FP 10 running Linux RedHat 4.0. I have created a system temporary tablespace and now I want to delete it. However: $ db2 "drop tablespace reorg" DB21034E The command was...
1
by: dotnettester | last post by:
Hi, I have a secure page that users use to login to the site. Once the user has successfully signed in I transfer him to a nonsercure content page. But at this transition user is prompted that...
2
by: Emil | last post by:
Hi, if you open the link below and click on "Show Me" and then "Toggle Transition" Button you will see a wonderfull fade in / fade out transition of 2 pictures. ...
14
by: Gale | last post by:
I wrote a simple script for image rotation. now i need to have some transition effect betwean images in JS What do you suggest ? Thank you
2
by: | last post by:
Is it possible to use IE transition effects (e.g. progid:DXImageTransform.Microsoft.Fade(Duration=2)">) to smooth "classic" (IE non-ATLAS) datagrid paging? How do you wire up the transition effect...
4
by: scoobydoo9749 | last post by:
So I was on here the other day looking for help with the getElementByName method and recieved excellent help quickly. (Thankyou GITS) Now, I'm looking for some help with making some dynamic content...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.