Determine if Page Refreshed

Discussion in 'ASP General' started by Keith, Nov 6, 2003.

  1. Keith

    Keith Guest

    First I would question why you want to do this. If they
    get to the page by any means it should respond
    appropriately, whether refresh or by link. This is a
    stateless environment after all.

    That being said...

    I would take the approach of setting a session variable
    that gets set the first time they hit the page:

    <%
    if session("NotTheFirstTime") = "" then
    'write the onload
    session("NotTheFirstTime") = true
    end if
    %>

    then based on that variable write or don't write the
    onload.

    Of course, if the user can access the page from multiple
    links and the onload is valid for each link, regardless of
    how many times they hit the page, this won't work.

    >-----Original Message-----
    >Is there a way to determine if a page is loading from a
    >refresh (either by a page timeout or clicking the refresh
    >button) vs. directly loading the page from a link. I
    >want to perform an onLoad event in the page only if it
    >was directly linked to; not if the page is being
    >refreshed.
    >
    >Thanks,
    >Don
    >.
    >
     
    Keith, Nov 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. x
    Replies:
    3
    Views:
    10,913
    Daisy
    Sep 3, 2003
  2. Alfons Puig
    Replies:
    0
    Views:
    312
    Alfons Puig
    Aug 28, 2003
  3. abdul bari
    Replies:
    1
    Views:
    468
    Stanley
    Aug 29, 2003
  4. Bill Cohagan
    Replies:
    4
    Views:
    4,193
    Jacob Yang [MSFT]
    Dec 5, 2003
  5. sanjay patil via .NET 247

    Previous(Unwanted) event handled when page refreshed by key F5

    sanjay patil via .NET 247, Apr 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    403
    sanjay patil via .NET 247
    Apr 27, 2004
Loading...

Share This Page