Search code examples
asp.netlifecycle

Quickly check which part of the page lifecycle a control is in


Is there any way to check what events have fired during the asp.net webforms page/control lifecycle?

I know that I can manually add handlers for each event, but that seems a bit ... inefficient.

Is there a visualiser, or a property that I can check that will tell me whether these events have fired?

EDIT The reason I want to know this is that I am overriding the ViewState property of a custom control, and the viewstate disappears at some point, and I'd like to know at which point in the page lifecycle it is being overriden.


Solution

  • Once again, I'm answering my own question.

    What I wanted to do was to determine what events had fired in the page life cycle.

    This is actually pretty trivial: Enable tracing in the web.config, and then go to ~/Trace.axd to see what had fired.