473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Destroying objects in Page_Unload event

Hello:

I was trying to destroy objects in the Page_Unload event.

That's when I see that the Page_Unload event gets triggered when I load a
page, right after it completes page_load event! Why?

Venki
Nov 19 '05 #1
3 3000
When do you expect it to be invoked? The pages goes through its entire life
cycle (Init, Load, PreRender, Unload) for each page request. Unload happens
right after the server sends the content to the browser and so the server no
longer needs to maintain the objects. Remember, page requests are
stateless.

"vvenk" <vv***@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hello:

I was trying to destroy objects in the Page_Unload event.

That's when I see that the Page_Unload event gets triggered when I load a
page, right after it completes page_load event! Why?

Venki

Nov 19 '05 #2
vvenk wrote:
Hello:

I was trying to destroy objects in the Page_Unload event.

That's when I see that the Page_Unload event gets triggered when I
load a page, right after it completes page_load event! Why?

Venki

Any of the articles in this search will likely answer your question:
http://www.google.com/search?hl=en&l...age+life+cycle

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 19 '05 #3
Reposting is not a good idea. See my answer to your other post. If you can
find it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"vvenk" <vv***@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hello:

I was trying to destroy objects in the Page_Unload event.

That's when I see that the Page_Unload event gets triggered when I load a
page, right after it completes page_load event! Why?

Venki

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: tascien | last post by:
I found a use for Page_Unload event method... here is the scenario: 1. Page.aspx has DoStuff.ascx in it. 2. DoStuff.ascx has a button that updates child control label lbXml depending on user...
3
by: James Hawthorne | last post by:
Hi, I have created a asp.net web application and I hooked up page_unload so I can clean up some things when i close it down. The problem is, page_unload gets called when I first load the page, not...
1
by: Robert Scheer | last post by:
Hi. Debugging one of my pages I noticed that everytime I call the page, the first event to run is Page_Load and after it the Page_Unload. If I postback to the page the Page_Unload runs again....
19
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use...
4
by: Larry Morris | last post by:
The following code, pasted into a web form with a link button on it, will cause the page_unload event to fire twice. If I remove the response.redirect, the problem goes away :). I've got a work...
0
by: chefo | last post by:
Well, the subject describes my problem quite well :-) Here is some additional information. I use a common base class for all the pages in my project. It is derived from Page and it is not...
0
by: JeffM | last post by:
This seems odd, but it appears that the Page_Unload event is fired twice on a Response.Redirect or a Server.Transfer. The output below demonstrates that during the move from the first to the 2nd...
7
by: Cenk | last post by:
Hi, After converting my projects to ASP.Net 2.0 I have seen a problem with Page_unload. Ä°n framework 1.1 page_unload event fires when you are leaving the page or has closed the browser window....
0
by: Stina | last post by:
I have a problem with the Page_Unload event being called twice in a row on a redirect and I just can't figure out why. I have seen other threads on this subject but not found a solution to the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.