Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2004
    Posts
    10

    Unanswered: ASP page not processing on all occasions

    Hi there

    I have an ASP page displaying a users details if they are logged in and allowing them to add new details if not. The problem is it doesnt always seem to process the ASP every time I go to that page. I write to a text file to with debug statements to check its processing the code and its not writing on subsequent entries to the page other than the first.

    i.e user is logged in, database is searched for their record and database fields are transferred to vars and used to display their details on the page, they change the details and the same page processes and reads in their updated details via querystring and redisplays their updated record details. Problem is if user navigates away from this page and comes back it displays their original details and does not seem to process any of the ASP at the top of the page, I know this as the debug statements I write to a text file are not getting written.

    Can anyone help, this is very frustrating. Its as if the page is not reloading properly or the session variables are not resetting.

    thx
    Many Thanks
    Siobhan

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    sounds like a caching issue... I assume everything gets displayed properly if you force a refresh of the page...

  3. #3
    Join Date
    Apr 2004
    Posts
    10
    Hi, thx for your response...

    it does sound like a caching, does that mean its just displaying the original page with original values etc... it only works again if I close down IE completely and restart the application but this wont do for the real site as people can quite validly go navigate around the site and come back to that page.


    any ideas ?
    Many Thanks
    Siobhan

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Try adding this to the top of your page
    Code:
    <% Response.CacheControl = "no-cache" %>
    <% Response.AddHeader "Pragma", "no-cache" %> 
    <% Response.Expires = -1 %>
    If that doesn't work, attach a copy of the page and I will have a look at it....

  5. #5
    Join Date
    Apr 2004
    Posts
    10
    WOW I could hug you if you were nearby

    thank you so much, that works an absolute treat, is that something one should have on all pages or does it depend on the computer you are running and its settings
    Many Thanks
    Siobhan

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    it more depends on the page then anything else....

    some pages you will never have a problem with due to the way they are processed....

    if you want to be sure 100% of the time create an asp include file called headers.asp or something and drop those lines into it and include the headers.asp file in all pages...

  7. #7
    Join Date
    Apr 2004
    Posts
    10
    good idea, will do that

    sorry to be a pain but just trying to understand why it would happen on some pages and not others, is it due to how complicated the ASP is for instance ?
    Many Thanks
    Siobhan

  8. #8
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    nah, I don't think so,... unfortunately it has been so long since I did some serious asp work that I can't remember what will cause some pages to cach and not others... sorry...

  9. #9
    Join Date
    Apr 2004
    Posts
    10
    ok, well thanks again
    Many Thanks
    Siobhan

Posting Permissions

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