Processing, please wait

Results 1 to 9 of 9

Thread: Processing, please wait

  1. #1

    Default Processing, please wait

    How is it possible to redirect to a page that displays a simple message such as "Processing your request, please wait" whilst an sql query is carried out. I would then like to redirect to another page once the results are completed.<BR><BR>Ive tried a simple redirect to a page that carries out the actual sql statement, but for some strange reason, it appears to simply &#039;skip over&#039; the page I have pointed to and goes straight to the final page. Weird? Is there some sort of &#039;wait&#039; command or something that can hold the page?<BR><BR>John

  2. #2
    Join Date
    Dec 1969

    Default Why wait?

    Depending on exactly what you&#039;re doing, why not just Response.Flush() some text to the client. This is basically what quite a few places do.<BR><BR>You could even go the whole hog. Output a small graphical progress bar, then Response.Flush() some JS out to the client to update the progress bar...<BR><BR>But that&#039;s possibly a bit beyond what you&#039;re after...<BR><BR>Craig.

  3. #3

    Default Response.flush?

    Havent heard of it...<BR><BR>Anyway, some of my sql queries are quite lengthy and can take, depending upon the user, up to 15 - 20 seconds, Id just like to throw a message to screen that gives an indication to the user that the query is infact underway and processing.<BR><BR>Ive seen this done before on many search engines built within sites. <BR><BR>They way in which the browser skips over the page is quite wierd when using response.redirect. Bascially what I have tried is this...<BR><BR>1. Begin the process by clicking on submit on the first page<BR>2. Redirect to the page that holds the query, with a short message saying processing, please wait.<BR>3. Show message indicating the results of the query on the following page.<BR><BR>For some strange reason the first page hangs while the query is run and then it throws to the last page. I cant understand why it does this? What are my alternatives?<BR><BR>John

  4. #4
    Join Date
    Dec 1969

    Default RE: Response.flush?

    Look it up then, because I think it&#039;ll solve your problems.<BR><BR>What&#039;s probably actually happening at stage 2 is this:<BR>1) Browser requests page<BR>2) HTML is outputted to the server BUFFER<BR>3) Your query is executed<BR>4) Redirect is outputted to the server BUFFER<BR>5) Buffer is streamed to client, including redirect<BR><BR>The buffer&#039;s not actually sent to the client (on a default IIS 5 installation) until either the script finishes executing, or you execute Response.Flush().<BR><BR>Note that if you use Response.Flush(), you can&#039;t later use a Response.Redirect(). You&#039;d have to instead do the redirect using JavaScript.<BR><BR>Craig.

  5. #5

    Default Ok I think I've found something<BR><BR>Id say this is exactly what I need.<BR><BR>What do you think Craig?<BR><BR>John

  6. #6
    Join Date
    Dec 1969

    Default RE: Ok I think I've found something

    Bingo.<BR><BR>That&#039;s exactly what I was talking about. The example you posted to kinda complicates the issue by adding in loads of JavaScript and things, but the principle&#039;s the same.<BR><BR>Craig.

  7. #7

    Default cool<eom>

    Thanks man,<BR><BR>John

  8. #8

    Default Further assistace required...HELP!

    Guys Ive tried using the response.flush command but without luck.<BR><BR>Heres what Im working with...<BR><BR>I have this at the very top of the page...<BR><BR>Response.Buffer = True<BR><BR>Then I have these everywhere because Im not sure where to put them..? It doesnt seem to make any difference though?<BR><BR>response.Flush()<BR> <BR>Then my message which I would like to display whilst the sql query is executing. It doesnt display this until its already finished. Which means Im sitting here looking at a blank screen....AAAAGGHH!!<BR><BR>"Your request is being processed, please wait"<BR><BR>Just thought id try one at the luck!<BR><BR>response.Flush()<BR> <BR><BR>Heres my query...<BR><BR>DIM mystring : mystring = session("mystring")<BR> &#039;convert to an array<BR> DIM myarray : myarray = Split(mystring,",")<BR> DIM the_counter &#039;Just declare the variable<BR> <BR> For the_counter = 0 to UBound(myarray)<BR> &#039;response.write myarray(the_counter) & "<BR>"<BR> EventDate = MediumDate(cdate(myarray(the_counter)))<BR> sql = "SELECT event_masterSTART, event_masterFINISH, venue_booked " <BR> sql = sql & "FROM venue_booked WHERE venue_booked = " & Cint(request.form("sublocation_select")) <BR> sql = sql & " AND &#039;" & EventDate & " " & session("start_time") & "&#039; BETWEEN event_masterSTART AND event_masterFINISH " <BR> sql = sql & "Or venue_booked = " & Cint(request.form("sublocation_select")) & " AND &#039;" & EventDate & " " & session("finish_time") & "&#039; BETWEEN event_masterSTART AND event_masterFINISH " <BR> sql = sql & "Or venue_booked = " & Cint(request.form("sublocation_select")) & " AND &#039;" & EventDate & " " & session("start_time") & "&#039; &#060; event_masterSTART AND &#039;" & EventDate & " " & session("finish_time") & "&#039; &#062; event_masterFINISH "<BR> <BR><BR>Another one for good measure...<BR><BR>Response.Flush<BR><BR>Ive got a few recordsets in here and so forth, but nothing special...<BR><BR>Then on to the next one...<BR><BR>next<BR><BR><BR>It does seem to show my global header, but nothing else until the query has completed. I would like to show the page in its entirity with a message that reads "Please Wait" and then proceed once the query has completed. Surely this isnt too hard...<BR><BR>Thanks,<BR><BR>John

  9. #9
    Join Date
    Dec 1969

    Default Well I don't know the method

    you were trying to use to do this. But I have done something similar and this is how I did it. First build an html page with the waiting message. In that page have a javascript function that does this:<BR><BR>function LaunchQueries(obj) <BR>{<BR> obj.window.location.href = &#039;doqueries.asp&#039;;<BR>}<BR><BR>Call it from the onload of the html page like this:<BR>&#060;BODY onload="javascript:LaunchQueries(this);"&#062;<BR> <BR>Start the doqueries.asp page with your completion message "Query finally done" or something. What will happen is the first page will load and redirect to the page where the long query runs but because the headers aren&#039;t written to the browser until processing is completed it just sits there while the queries run. When the processing completes, the page the headers are written to the browser and it says finished. Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts