views:

50

answers:

2

If you were asked in an interview to describe the ASP.net lifecycle what would you answer?

What I have memorised so far is...

SILVERU or

Start Initialization Load Validation Postback Event Handling Render Unload

Would giving that list be enough of an answer?

I doubt it so if it is not enough then what would one have to say?

+2  A: 

Try this.

http://blogs.msdn.com/b/aspnetue/archive/2010/01/14/asp-net-page-life-cycle-diagram.aspx

Rahul Soni
I have printed that diagram already. I am just trying to make sure I understand enough to answer the question. I have been doing some small projects and I want to be able to answer this question.
Nathan Stanford
I would normally keep it short if I had to answer this. For ex.ASP.NET Life Cycle ensure that we can work with a Page object as if it had a state. We know that HTTP is a stateless protocol and ASP.NET provides the model with which the state of the page is saved and we can work on it even after postbacks.
Rahul Soni
When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering. It is important for you to understand the page life cycle so that you can write code at the appropriate life-cycle stage for the effect you intend.
Rahul Soni
A: 

You also need to know the purpose of each step, and what you should place in each.

For example:

  • When is view state values available on the way in?
  • When is the last time view state values can be changed on the way out.
  • Why is it a bad idea to hit a database in OnInit?

Actually good you asked this question, now I know to probe a bit deeper next time I interview someone :)

Shiraz Bhaiji
Of course that is why I am asking what your answers would be if you had to answer orally. Then I can study this more.
Nathan Stanford