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
0
votes
3 answers

Access asp.net page from a code behind class

This is for academic purposes, please no responses of "why would you want to do that" If I have a page called Home.aspx and it has a code behind Home.aspx.cs. In Home.aspx.cs I have some public properties, e.g. public string Name { get; set; } I…
tom
  • 1,822
  • 4
  • 25
  • 43
0
votes
2 answers

ASP.NET page life cycle issue. Control ViewState in Page_InitComplete on postback

Our users will: 1.open one tab do some tasks 2.open another tab change customerId and do some other task 3.return to the previous tab and attempt to continue with the old customerId The session state will have changed to include the new customerId.…
user1161495
  • 77
  • 1
  • 2
  • 10
0
votes
0 answers

Textchanges only visible after postback

I have a method that changes the text of the controls on my site. These changes should be visible right when the user loads the page. But the changes are first visible after the next postback. I tried to call it in Page_PreInit, Page_Init,…
Torben L.
  • 73
  • 1
  • 10
0
votes
1 answer

Accessing session from static method called via AJAX

Ok, I'm a little stuck on this one. I think my problem lies with the life cycle of the page but I'm not sure nor am I sure how to fix the problem. I have a static method that needs access to the Session. However, this method gets called in the…
Icestorm0141
  • 662
  • 2
  • 9
  • 21
0
votes
1 answer

Trying to get the HTML of a control in a IHttpHandler

I have created a class that implements IHttpHandler, and I need it to return the rendered HTML of a databound user control that I have made. While I can get this to work, it doens't work exactly as I'd hoped... Basically, I make a new Page(), and…
MadSkunk
  • 3,309
  • 2
  • 32
  • 49
0
votes
3 answers

How is this explained with ASP.NET page life cycle?

I have the following code, which simply inserts a record into the database, based on some text fields and a dropdown. The dropdown gets bound in the Page Load Event. protected void btnAdd_Click(object sender, EventArgs e) { try { …
Jorre
  • 17,273
  • 32
  • 100
  • 145
0
votes
0 answers

control where markup should appear on rendered page?

I am building a Extender control. This control derives from the normal Control. Its purpose is to inject some text before/after the specified target control. I imagine this to be similar to how the AJAX Calendar Extender works. So it has the…
deostroll
  • 11,661
  • 21
  • 90
  • 161
0
votes
2 answers

page life cycle make me confused?

i clicked abutton then depug enter page load before button click event i want to check in page load if this button clicked i used hiddenfield and javascript function like