473,804 Members | 3,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_windwa rd_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Feb 18 '07 #1
4 1957
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_windwa rd_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 PreRequestHandl erExecute event.

Raise the PostRequestHand lerExecute 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
6444
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 single article which can be viewed at http://www.tonymarston.net/php-mysql/good-bad-oop.html I fully expect this to be the start of another flame war, so sharpen your knives and get stuck in!
17
2000
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, even though they've not a clue what it means? IMHO the customer shouldnt really care as long as the product meets their requirements it's none of their concern if it was written in VB.NET or VB6.
4
1782
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 std::string. In this case this copy is anonymous, and the return value of its c_str() method is
10
2043
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 are destroyed before the function returns. Is this correct? (To the best of my knowledge it is) Where in the standard is this described?
4
1836
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. So I have Thread t = new Thread(new ThreadStart(targetMethod));
12
17430
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, and I would like to know what it is so that I can take advantage of it in my code. Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
2
1492
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 from Fusion Charts Instrumentation Suite to show the speed of machinary in a factory. The guage updates every 5 seconds. The guage update does not cause a refresh of the page that it is on, however it allows the definition of a DataStreamUrl and...
11
14832
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 processed by the web server. I am still struggling to understand this postback logic, and hope that some kind gurus out there could help me clarify the confusion I have.
3
2071
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 creation so that, should the creator neglect to remove it, browsers will not render it? If not should such a mechanism exist? Perhaps with page expired message? David F. Cox
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10330
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7616
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.