What is the lifespan of a Page object?

L

Laurent Bugnion [MVP]

Hi,

David said:
Hi;

When a Page object - the code-behind of an aspx page is created - what is
the lifespan of that created object? Is it tied to the session, the
request/response, or is it in a poll and reused for the next request/response
to that page from any session?

The Page object is created when the Request arrives, and is disposed
after the Response is sent. A new Page object is created for each Request.

This is pretty heavy, that's why lightweight custom handlers like ASHX
are sometimes preferrable for intense traffic.

HTH,
Laurent
 
G

Guest

That helps - boy that is heavy. I like java stateless session beans - it just
keeps a pool of them so no big hit once the site starts.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Laurent Bugnion said:
Hi,

David said:
Hi;

When a Page object - the code-behind of an aspx page is created - what is
the lifespan of that created object? Is it tied to the session, the
request/response, or is it in a poll and reused for the next request/response
to that page from any session?

The Page object is created when the Request arrives, and is disposed
after the Response is sent. A new Page object is created for each Request.

This is pretty heavy, that's why lightweight custom handlers like ASHX
are sometimes preferrable for intense traffic.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 
G

Guest

David said:
That helps - boy that is heavy. I like java stateless session beans - it just
keeps a pool of them so no big hit once the site starts.

Not so very heavy. If it really would have been that heavy, they would
have been pooled. For any regular web page it works just fine.
 
S

Steven Cheng[MSFT]

Some additional info on this.

Hi Dave,

You can check the following MSDN reference:

#ASP.NET Application Life Cycle Overview
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

And notice these two events:

Raise the PreRequestHandlerExecute event.

Raise the PostRequestHandlerExecute event.

Between these two events, the runtime pipeline will locate a proper
httphandler to process the request. For aspx page, the handler is just the
corresponding page class. Therefore the page's whole lifecycle can be
considered as a sub period of the application request's lifecycle.

Hope this helps further.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top