|
-
May 2nd, 2001, 11:40 AM
#1
Thread Starter
Addicted Member
implementing 'please wait' page
Ok i'm using webclasses to build an IIS app.
I need to obtain the following:
When a user clicks a link, a query is fired on a database that takes quite some time to run.
I want to show a "please wait" page during the processing, and upon completion of the query, load the actual page, replacing this 'wait' page.
I don't seem to see how this can be done using the Response object (within a response, all Response.Write or myTemplate.WriteTemplate only performs appends instead of replacement).
How do I do this? I know javascript may be a solution but I prefer handling this on the server I it's possible (specially to have the 'wait' page stay until the query finishes).
thanks in advance
-
May 2nd, 2001, 02:07 PM
#2
Frenzied Member
Why not Response.Redirect.
Once the query is done, you can either, generate the page and save it to a file on the server (one which you will want to delete later) or send the data to the new page via Session() or Request.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 2nd, 2001, 03:16 PM
#3
Thread Starter
Addicted Member
ok, maybe I need to look further on Session or Request object.
Just to help me on the way, are you saying there's a method of these objects that can be used to 'push' another page to the window?
-
May 2nd, 2001, 03:34 PM
#4
Frenzied Member
Well, there is a Response.Redirect method that will trigger another browser request action. Your ASP would look like this:
Code:
<%Randomize%>
<html>
<!--- This is the first page after the browser makes the request. This is the hold page -->
<head></head>
<body>
<p>Please hold while I retrieve that information.</p>
<%
Response.Redirect("NextPage.asp");
%>
</body>
</html>
Anyway, sorry about the confusion before, but as I write this I realize that the browser won't show the page until he gets it, and the server won't serve the page until the entire ASP script is finished.
Anyway... what the page above will do is show the wait message, and then it will trigger an event in the browser that will ask for the next page. The end user will see the please wait page while his web browser asks for the end result page. That page will take a moment as the SQL query runs.
On the page previous to this one you can set Session() variables:
Code:
Session("someVar") = someValue
Or you can have the script on the page above convert Request.Form data to Session data:
Code:
Session("someVar") = Request.Form("someVar")
And then on the next page you can just ask for Session("someVar"):
Code:
TabletoQuery = Session("someVar")
I hope this makes sense. I find that I'm not really good at explaining things.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 2nd, 2001, 03:57 PM
#5
Thread Starter
Addicted Member
what if..
hmm, thanks this can be useful
but what if i avoid using server side script on the page and handle everything from within the webclass.. how do I handle this then?
-
May 2nd, 2001, 04:17 PM
#6
Frenzied Member
Ah, well.. I don't know how to do a SQL Query with client-side scripting.
Now, the client-side scripting (JavaScript) would do a very tidy job of showing a layer that read "Please wait." and then hiding and removing that and showing the query results.
Problem is, if the DB is on the server side, I don't know enough to know how to get the client side script to query it. Its my understanidng that it is not possible, but I'm not going to say that. I may be wrong.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 3rd, 2001, 02:50 AM
#7
Thread Starter
Addicted Member
i think i wasn't very clear in my last remarks..
i meant, i want to avoid using server side scripts (codes within the <% %> tags) in the page (=on the client side), not that i want to query from the client..
so this means i would have to put the .Redirect method somewhere in the webclass (that reside on the server side)...
i hope i'm a bit clearer now...
-
May 3rd, 2001, 08:17 AM
#8
Frenzied Member
I don't understand how you can avoid server-side scripts. The DB rest on the server-side, therefor I doubt a client-side script could affect a query.
If you can get a client-side script to hit the DB then you can use JavaScript to dynamicly change the HTML text in a layer on the page.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|