By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

Why is interstitial page not loading when VB function is called?

P: 3
I'm currently running a set of pages structured something like this:

1. QUERY FORM: user enters data and clicks 'Go'
2. DATA from FORM is stored in DB, then redirects to INTERSTITIAL page
3. INTERSTITIAL PAGE is loaded and calls VB function
VB function spits out data at intervals onto INTERSTITIAL page (progress bar)
4. When VB function is finished, it redirects to RESULTS page
5. RESULTS page appears
My problem currently is at step 3 where the INTERSTITIAL page never appears in the browser. It waits at the FORM page until the function is finished, then shows INTERSTITIAL page for a split second and finally goes straight to RESULTS.

I used fiddler and noticed that INTERSTITIAL page is called but no data is sent from the server (size=-1).

The INTERSTITIAL page is designed so that the call to the VB function is at the very end so the browser should load the page. The function has Response.Buffer set as False. This all used to work fine until recently. I rolled back to a previous which worked and now it fails as well.

INTERSTITIAL code:

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%
  3. response.Buffer = False
  4.  
  5. function myFunction()
  6. Dim PauseTime, Start
  7.  
  8. PauseTime = 3 'Set Duration
  9. Start = Timer 'Set start time
  10.  
  11. Do While Timer < Start + PauseTime
  12.   'nothing happening
  13. Loop
  14. response.Write("<script>$('p').html('1')</script>")
  15. End function
  16.  
  17. %>
  18.  
  19. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  20. <html xmlns="http://www.w3.org/1999/xhtml">
  21. <head>
  22. <script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
  23. </head>
  24.  
  25. <body>
  26. <p>0</p>
  27.  
  28. <% call myFunction %>
  29.  
  30. </body>
  31. </html>
  32.  
If anyone has any clues as to why this may be I would be greatly indebted.
Jan 19 '11 #1
Share this Question
Share on Google+
4 Replies


jhardman
Expert 2.5K+
P: 3,405
It looks like despite unbufferring the script, it still is not sending the page until the script finishes. Try removing the function and just put that code inline at the end. If that resolves it I think I know what's wrong.

Jared
Jan 20 '11 #2

P: 3
Placing the code inline isn't doing it.
Jan 20 '11 #3

jhardman
Expert 2.5K+
P: 3,405
I guess I'm not too surprised. I've had very mixed results with the response buffer. I feel confident the page isn't being sent until the script finishes, but I can't tell why.

Have you considered sending the page whole and using javascript or ajax to chart your progress?

Jared
Jan 20 '11 #4

P: 3
Yes I have. It's not the best process the one I have now but it worked at one point. It's an intermittent issue apparently so I guess it will have to do until I take the whole thing apart and put it back together in a different way.

Thanks for your help.
Jan 20 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.