Page_Unload question
-
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
-
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
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
-
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