script block added by the RegisterStartupScript

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top