views:

44

answers:

4

When an asp.net button is fired, will the button's event get fired before the page_load and init and pre_init events?

+4  A: 

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

Page_Load goes before event handlers.

Cory Grimster
+2  A: 

Just stick some breakpoints in the different functions and see which one fires first. I think the answer is no.

Peter
+1  A: 

Make a page with page init, load (also variations of ispostback), prerender, unload and control events and do a trace to see when they all fire off - easier to remember too when you do it as opposed to reading it.

Steve
+1  A: 

Page_Load, init and pre_init will happen before the button can receive any user input, so it will definitely happen before the button can fire off any events as a result of user input.

John Knoeller