When a button is clicked, will then button's event fire before page_load?
When an asp.net button is fired, will the button's event get fired befo开发者_运维知识库re the page_load and init and pre_init events?
http://msdn.microsoft.com/en-us/library/ms178472.aspx
Page_Load goes before event handlers.
Just stick some breakpoints in the different functions and see which one fires first. I think the answer is no.
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.
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.
精彩评论