Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP pages blank until refreshed

Status
Not open for further replies.

DivideOverflow

Programmer
Oct 29, 2003
5
US
After searching the forums for a bit, I haven't found anything exactly like what's happening with my ASP pages, so I figured it wouldn't hurt to start a new thread.

I have an online application made up of ASP pages (IIS 5.0 on Windows 2000 Server) drawing data from a SQL Server database. Most of the time, everything works exactly as it should. Connections are opened to the database, queries are run and data is returned and writen out, connections are closed, etc.

However, every so often a page simply won't load. It isn't trying to load and then timing out or anything, it's like it's ignoring the page entirely. It shows the correct URL in the address bar of IE, but there's nothing but a blank white page displayed. Viewing the source of the blank page reveals that instead of the correct code for the page, we get this:

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML><HEAD>
<META http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;></HEAD>
<BODY></BODY></HTML>

Refreshing the page will make it load correctly, although sometimes it can take quite a few refreshes before it does. The problem seems more prevalent when we have multiple users on the system at once. The problem also seems to go away right after the IIS service is restarted and will come back after the system has been in use for a while.

In general, what kind of situations would cause an ASP page not to load at all, not to return any kind of error, and simply be replaced by the blank code above? Any tips on what I should be looking for to narrow this down would be greatly appreciated.
 
Make sure to close open connections and recordsets. You may also want to set response.expires = 0 on each page...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
When I first inherited this application, almost all of the recordsets were opening connections implicitly and that caused quite a few sleeping connections to build up on the SQL Server until IIS was restarted. Since then I've converted everything to explicitly open and then close all recordsets and connections and set them to nothing. I no longer get the &quot;connection creep&quot; that was being caused before, but I still get the mysterious blank page problem sporadically.

I've tried Response.Expires = 0 as well as Response.Expires = -1 and the problem perists. I've also toyed around with Response.Buffer = true and Response.Buffer = false and get the same thing either way.
 
Oh, one other thing: we have two versions of the application, identical in every way except that our public version uses SSL ( and the private testing version does not ( The testing version of the site has never had this problem, although it also never has the volume of use the live site has...
 
Hi,

This is a bit of a messy way to handle things, but you could try redirecting away from the page first. The page that you redirect to could send you back to the correct page thus forcing the refresh.

Cheers

ab
 
Set response.buffer = True and use response.flush at appropriate points in your code loops to flush the buffer out to the page.



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top