What does "Page Load" and "Page Unload", "Page Life Cycle" exactlymean????

  • Thread starter Thread starter lander
  • Start date Start date
L

lander

I've read the page life cycle thing in msdn, still, i'm getting a bit
confused of thinking how all the things are going under the hood...

I know that when page loading, that the controls' properties is
populated and when page unloading, the resources are cleared.

What I want to know is what's happening behind it, that is, from the
perspective of the asp.net implementor.....I'm not sure whether i've
stated clearly, hope you get it.

And, as for page life cycle. Does it mean that a request comes in a
page object and a HTTPContext object is contructed for the request,
when the request has been processed, the page object is destroyed as
well as all other resources......I'm not very sure of it...

Thanks for your attention...
 
lander said:
I've read the page life cycle thing in msdn, still, i'm getting a bit
confused of thinking how all the things are going under the hood...

I know that when page loading, that the controls' properties is
populated and when page unloading, the resources are cleared.

What I want to know is what's happening behind it, that is, from the
perspective of the asp.net implementor.....I'm not sure whether i've
stated clearly, hope you get it.

And, as for page life cycle. Does it mean that a request comes in a
page object and a HTTPContext object is contructed for the request,
when the request has been processed, the page object is destroyed as
well as all other resources......I'm not very sure of it...

Thanks for your attention...

I am not an expert but still give you some comments.

You are right , when the request comes in, the ASP.NET instantiates the
object for corresponding class, executes the required events, and then
finally unloades it after emitting the HTML to client.

May be you can read more on Page Life Cycle on ASP.NET
 
Hello lander,

I recommend you to use .NET Reflector http://www.aisto.com/roeder/dotnet/
to check what happens inside that methods


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


l> I've read the page life cycle thing in msdn, still, i'm getting a bit
l> confused of thinking how all the things are going under the hood...
l>
l> I know that when page loading, that the controls' properties is
l> populated and when page unloading, the resources are cleared.
l>
l> What I want to know is what's happening behind it, that is, from the
l> perspective of the asp.net implementor.....I'm not sure whether i've
l> stated clearly, hope you get it.
l>
l> And, as for page life cycle. Does it mean that a request comes in a
l> page object and a HTTPContext object is contructed for the request,
l> when the request has been processed, the page object is destroyed as
l> well as all other resources......I'm not very sure of it...
l>
l> Thanks for your attention...
l>
 
Hello lander,

I recommend you to use .NET Reflector http://www.aisto.com/roeder/dotnet/
to check what happens inside these methods


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


l> I've read the page life cycle thing in msdn, still, i'm getting a bit
l> confused of thinking how all the things are going under the hood...
l>
l> I know that when page loading, that the controls' properties is
l> populated and when page unloading, the resources are cleared.
l>
l> What I want to know is what's happening behind it, that is, from the
l> perspective of the asp.net implementor.....I'm not sure whether i've
l> stated clearly, hope you get it.
l>
l> And, as for page life cycle. Does it mean that a request comes in a
l> page object and a HTTPContext object is contructed for the request,
l> when the request has been processed, the page object is destroyed as
l> well as all other resources......I'm not very sure of it...
l>
l> Thanks for your attention...
l>
 
That is how WebServer /Browser (any web server) work

Browser connects to server, asks for URL, takes a response, Disconnect.....

thus if you have one HTML page with 3 images on it, Browser will connect,
ask for HTML, disconnect
Connect again, ask for 1st image, disconnect
Connect again, ask for 2nd image, disconnect
Connect again, ask for 3rd image, disconnect



George,.
 
And, as for page life cycle, does it mean that a request comes in a
page object and a HTTPContext object is contsructed for the request,
when the request has been processed, the page object is destroyed as
well as all other resources?

Yes.

The web works on a request / response architecture.

A client (e.g. a web browser) sends an HttpRequest to a web server.

The web server processes the HttpRequest, and then sends back an
HttpResponse if it can.

The web server has not the slightest idea what the client does with that
HttpResponse because, apart from very exceptional cases, there is no
permanent between web browser and web server...

This is often the most difficult concept for WinForms developers to grasp,
and one of the reasons why e.g. a web server can't know when a web browser
has been closed or even when the user has navigated away to another site...
 
Back
Top