Questions tagged [page-lifecycle]

When a page is requested on the web the server goes through a number of stages before sending back a response. Thus, the page life cycle is runs between request to response on the server.

Main steps in lifecycle are:

  1. Page request
  2. Start
  3. Initialization
  4. Load
  5. Postback event handling (if it is a postback request)
  6. Rendering
  7. Unload

More information: http://msdn.microsoft.com/en-us/library/ms178472.aspx

471 questions
7
votes
5 answers

what is the difference between postback data and view state data

I am trying to understand different events in a Asp.net page life cycle. I came across to this link. It has two stages Load view state and Load postback data. I used to thought that these both means the same thing. But this article says, that…
Vaibhav Jain
  • 33,887
  • 46
  • 110
  • 163
7
votes
6 answers

Where should stuff be done in an ASP.NET page?

I'm very new to ASP.NET and, after beating my head on a few problems, I'm wondering if I'm doing things wrong (I've got a bad habit of doing that). I'm interested in learning about how ASP.NET operates. My question is: Where can I find documentation…
BCS
  • 75,627
  • 68
  • 187
  • 294
6
votes
5 answers

What's the meaning of Web Page life-cycle?

I'm new to C# and ASP.NET. I hear a lot about application and/or web page life-cycle. I want to know what's the meaning of this?
user920500
6
votes
3 answers

ASP.NET page events - Button click event comes after GridView bind

My understanding of the order of page events is this: Page : Load Control : DataBind (for a GridView or whatever) Control : Load Control : Clicked (for a Button) Page: PreRender Control : PreRender (There are lots of others - but these are the…
TallGuy
  • 1,873
  • 6
  • 22
  • 35
6
votes
2 answers

How to Delay Calling a function After full page loaded on aspx with c#

Below is my simple source code, I'm just trying to call that function after page load, but what is happening right now is: it calls that function before page load. Page loads for 5 seconds and, after that, it displays label execution. protected void…
Jitender
  • 330
  • 2
  • 11
6
votes
2 answers

Why do subcontrols initialize before their containers?

Despite working with WebForms for years I still find myself getting confused about the event lifecycle from time to time. This isn't so much a problem that needs resolving, as hoping to get a better understanding of why things work the way they…
Jamie Treworgy
  • 23,934
  • 8
  • 76
  • 119
6
votes
4 answers

Have I completely misunderstood ASP.Net AJAX (Update Panel)?

I've may have misunderstood how AJAX works - Can someone shed some light on the following simplified scenario: I have a asp.net web application. On a page there is a user control inside an update panel (with no properties changed) and a script…
Mr Shoubs
  • 14,629
  • 17
  • 68
  • 107
6
votes
10 answers

Is it acceptable to keep a db connection open for the life of the page?

Everybody knows that you should close a connection immediately after you finish using it. Due to a flaw in my domain object model design, I've had to leave the connection open for the full page life cycle. Essentially, I have a Just In Time…
John MacIntyre
  • 12,910
  • 13
  • 67
  • 106
6
votes
2 answers

On which Page life cycle are the Client IDs generated?

i am programatically adding Webcontrols in to a User Control i am also adding a javascript event passing the controlID as a parameter but the clientID is the one i assigned a it does not contain the one that asp.net generates var txt = new…
Oscar Cabrero
  • 4,168
  • 8
  • 29
  • 49
6
votes
1 answer

When and how is clientID generated in JSF?

In order to more understand the clientID generation in JSF (2.x), could someone explain to me when exactely does JSF generates the client ID (which lifecycle phase, build time or render time ...)? And how the client ID will be generated (if…
Tarik
  • 4,961
  • 3
  • 36
  • 67
6
votes
3 answers

How does IIS server identify that request is mvc request?

In asp.net life cycle, on basis of the extension (.aspx), the request would be identified and handled by aspnet_isapi.dll and then httpapplication object is created followed by request and response objects and then request is processed by…
Mrudang Vora
  • 255
  • 1
  • 5
  • 20
6
votes
3 answers

Should I wait for ajax to complete to redirect a page?

I know how to wait for ajax to complete, but if I'm going to redirect a page after some ajax calls are fired off, should I wait for them to complete before the redirect? Does it matter?
elijah
  • 2,904
  • 1
  • 17
  • 21
6
votes
3 answers

Best way to intercept a Button postback

I've seen other solutions like this one which is pretty straightforward but what if the javascript function does more than just confirm('sure?');? I never know when it will return a bool. So I've decided to implement all my ASP.NET Buttons like…
notAnonymousAnymore
  • 2,637
  • 9
  • 49
  • 74
6
votes
2 answers

Wiring up the Page_PreInit event manually, with AutoEventWireup set to false

If the AutoEventWireup attribute is set to false, the events need to be wired up manually. However, I cannot seem to get the Page_PreInit to fire. I would guess that I might be making the wireup happen too late (once we're already past…
CptSupermrkt
  • 6,844
  • 12
  • 56
  • 87
5
votes
1 answer

Strange behavior of nullable Enum types

I am using Global.asax to perform logging at the end of each request via the Application_EndRequest event. However, I am seeing some odd behavior of certain values stored in the HTTPContext.Current.Items collection. Below is the debug output for a…
James
  • 7,877
  • 7
  • 42
  • 57
1 2
3
31 32