Z
zhuang
Hi,
In this article,
http://msdn2.microsoft.com/en-us/library/asz8zsxy.aspx#
It mentioned
The script block added by the RegisterStartupScript method executes
when the page finishes loading but before the page's OnLoad event is
raised.
I created a simple web project with a button control only, in
Button1_Click method, I registered
a javascript block which is just a alert.
When I click button, the Page_Load happens first, and then
Button1_Click, then alert message box comes out. Before I read the
article, I never have any question about this sequence, since script is
only registered when button click even is handled, which always after
Page_Load.
Could someone get me some idea why the article says "when the page
finishes loading but before the page's OnLoad event is raised"
Thanks
zhuang
In this article,
http://msdn2.microsoft.com/en-us/library/asz8zsxy.aspx#
It mentioned
The script block added by the RegisterStartupScript method executes
when the page finishes loading but before the page's OnLoad event is
raised.
I created a simple web project with a button control only, in
Button1_Click method, I registered
a javascript block which is just a alert.
When I click button, the Page_Load happens first, and then
Button1_Click, then alert message box comes out. Before I read the
article, I never have any question about this sequence, since script is
only registered when button click even is handled, which always after
Page_Load.
Could someone get me some idea why the article says "when the page
finishes loading but before the page's OnLoad event is raised"
Thanks
zhuang