does page reload on back button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramanaths
    New Member
    • Oct 2007
    • 1

    #1

    does page reload on back button?

    Hi

    I have a page that shows many thumbnail images. on load of this page i have some code that invokes a javascript which shows a message saying 'loading images'... this is hidden once all the page/images loads fully. when i navigate to some other page and then hit the back button of the browser the javascript fires and i get the 'loading images'. the images load fast (maybe from cache). but i was thinking i shouldn't be getting the 'loading images' message.

    on going to a page by clicking the back button in the browser does the page reload all over again? i would think it should just go back and not do the reload. isn't that how it should work? is there a way i avoid page load (events)?

    thnx.
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Welcome to TSDN. Usual way is to use if not Page.IsPostBack :
    If Not Page.IsPostBack

    Comment

    • nateraaaa
      Recognized Expert Contributor
      • May 2007
      • 664

      #3
      The page_load event will fire every time the page is sent to the server via a postback. If you want to show something the first time the page is accessed use the the !IsPostBack method as kenobewan mentioned. You can see this if you put a break point in your page_load event and do any of the following:

      Click refresh.
      Hit browser back button.
      Do any type of postback event. (button click, etc..)

      Nathan

      Comment

      Working...