ASP pages blank until refreshed

Results 1 to 2 of 2

Thread: ASP pages blank until refreshed

  1. #1
    Join Date
    Dec 1969

    Default ASP pages blank until refreshed

    After searching the forums for a bit, I haven&#039;t found anything exactly like what&#039;s happening with my ASP pages, so I figured it wouldn&#039;t hurt to start a new thread. <BR><BR>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. <BR><BR>However, every so often a page simply won&#039;t load. It isn&#039;t trying to load and then timing out or anything, it&#039;s like it&#039;s ignoring the page entirely. It shows the correct URL in the address bar of IE, but there&#039;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: <BR><BR>&#060;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&#062; <BR>&#060;HTML&#062;&#060;HEAD&#062; <BR>&#060;META http-equiv=Content-Type content="text/html; charset=windows-1252"&#062;&#060;/HEAD&#062; <BR>&#060;BODY&#062;&#060;/BODY&#062;&#060;/HTML&#062; <BR><BR>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. I&#039;ve tried Response.Expires = 0 as well as Response.Expires = -1 and the problem perists. I&#039;ve also toyed around with Response.Buffer = true and Response.Buffer = false and get the same thing either way. <BR><BR>When I first inherited this application, almost all of the recordsets were opening connections implicitly and never closing them and that caused quite a few sleeping connections to build up on the SQL Server until IIS was restarted. Since then I&#039;ve converted everything to explicitly open and then close all recordsets and connections and set them to nothing. I no longer get the "connection creep" that was being caused before, but I still get the mysterious blank page problem sporadically. <BR><BR>We have two versions of the application, identical in every way except that our public version uses SSL (https://) and the private testing version does not (http://). The testing version of the site has never had this problem, although it also never has the volume of use the live site has... <BR><BR>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.

  2. #2
    Join Date
    Dec 1969

    Default I must admit, I stopped reading your... about halfway through, but by the sounds of it, your server is struggling to deal with all database requests at the same time. It&#039;s like it starts off all right, but then, over time, gets in a muddle. Reloading a page would eventually clear it, because the server would at some point have enough resources to deal with the database requests and serve the page.<BR><BR>First of all I would make sure that you close EVERY recordset and connection (in that order). I know, you said that all recordsets and connections are being closed, but it&#039;s worth going through the code again, just in case you missed something. Also, don&#039;t rely on the server to close everything itself after the page has been served. That should happen, but doesn&#039;t always seem to happen.<BR><BR>I had a similar problem before and found that I had missed closing the recordset and connection in one place and I got very similar symptoms to yours.<BR><BR>Also, use some error trapping. I program in JScript and it&#039;s brilliant to use a try/catch statement to make sure that everything gets closed, even if there is an error.<BR><BR>I had this problem also where I had missed an error condition and even though the page was working correctly in 99% of cases, 1% failed and gave the site visitor an error message. Since the script (it was VBScript at the time) didn&#039;t execute all the way, the recordsets and connections weren&#039;t closed properly and eventually the server displayed the symptoms again.<BR><BR>That&#039;s my two cents anyway. I do strongly suggest you go through your code again and make sure everything is in order and you do your best to trap errors.<BR><BR>Oliver.

Posting Permissions

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