开发者

When a button is clicked, will then button's event fire before page_load?

开发者 https://www.devze.com 2022-12-23 03:55 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消