473,397 Members | 2,099 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,397 software developers and data experts.

What is the lifespan of a Page object?

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?

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

Cubicle Wars - http://www.windwardreports.com/film.htm
Feb 18 '07 #1
4 1939
Hi,

David Thielen wrote:
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
Feb 18 '07 #2
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 [MVP]" wrote:
Hi,

David Thielen wrote:
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
Feb 18 '07 #3
David Thielen wrote:
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.

--
Göran Andersson
_____
http://www.guffa.com
Feb 18 '07 #4
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.




Feb 19 '07 #5

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

Similar topics

52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
17
by: owen | last post by:
Your opinion please! Do end-users know, think they know, or even care, what .NET is.? Do customers hear the word ".NET" and think its the latest thing and must only have .NET applications,...
4
by: richardclay09 | last post by:
In this snippet: void f(const char* c) {...use c in a read-only way...} std::ostringstream oss; oss << "blah blah"; f(oss.str().c_str()); oss.str() returns a *copy* of the buffer as a...
10
by: int2str | last post by:
All, As the simple sample program below demonstrates, function arguments are destroyed after the return value of the function has been evaluated. As opposed to local function variables, which...
4
by: Nicholas Beenham | last post by:
Hi all, Is there a way to set the lifespan of a thread. I am trying to start a process that may or may not have an outcome and want to finish it after a certain length of time finished or not....
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
2
by: damian.jolly | last post by:
Is persisting objects to the SESSION the best way to prevent an object from being created every time a page is refreshed? It's a bit complicated but I'll try to be brief... I am using a guage...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
3
by: David Cox | last post by:
I found some details on a musical festival, made my plans, and only found out by chance that the site was two years out of date. Is there some HTML way of setting a lifespan on a webpage on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.