Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Page_Unload question

Page_Unload question

Scheduled Pinned Locked Moved C#
questioncsharpvisual-studiosysadminperformance
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sled Dog
    wrote on last edited by
    #1

    Am I missing something about how Visual Studio works? Page_Unload is executed the first time that I open a page. Is this designed to be this way? I thought that by its name, this method would be executed when the server removes the page from memory...not loading the page into memory. And, "yes" I can already see something of a conflict within my own statement. The Page_Unload method must be read into memory before the server can run it...but, that does not imply it should execute...does it? Any commentary to improve my understanding would be appreciated. Thanks. SD

    T 1 Reply Last reply
    0
    • S Sled Dog

      Am I missing something about how Visual Studio works? Page_Unload is executed the first time that I open a page. Is this designed to be this way? I thought that by its name, this method would be executed when the server removes the page from memory...not loading the page into memory. And, "yes" I can already see something of a conflict within my own statement. The Page_Unload method must be read into memory before the server can run it...but, that does not imply it should execute...does it? Any commentary to improve my understanding would be appreciated. Thanks. SD

      T Offline
      T Offline
      Tom Larsen
      wrote on last edited by
      #2

      I always thought "Load" and "Unload" where bad terms for web app API in this situation. In this case it should have been "Pre"/"Post" or some other pair of terms I'm drawing a blank on. :) The idea is that when the server touches the object for some activity it fires a "Load" and when it is done with it it fires a "Unload". The action that triggered the pair of events may not have anything to do with actual Html or sending data to the client. The object itself has a "lifetime" outside of these pair of events as well (the object might be created hours before the actual event, the object might not be disposed for hours). Ultimately, having web controls behave this way is desirable over being tied to create/destroy events. -- modified at 10:40 Friday 30th September, 2005

      S 1 Reply Last reply
      0
      • T Tom Larsen

        I always thought "Load" and "Unload" where bad terms for web app API in this situation. In this case it should have been "Pre"/"Post" or some other pair of terms I'm drawing a blank on. :) The idea is that when the server touches the object for some activity it fires a "Load" and when it is done with it it fires a "Unload". The action that triggered the pair of events may not have anything to do with actual Html or sending data to the client. The object itself has a "lifetime" outside of these pair of events as well (the object might be created hours before the actual event, the object might not be disposed for hours). Ultimately, having web controls behave this way is desirable over being tied to create/destroy events. -- modified at 10:40 Friday 30th September, 2005

        S Offline
        S Offline
        Sled Dog
        wrote on last edited by
        #3

        Tom, the flood lights just went on. Thanks for the terminology seperation, too. Page_Unload is not what I needed at all. Best Regards, William

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups