Sunday, March 11, 2012

Atlas mthods from pure JavaScript VS server-side RegisterStartupScript

Hi,

This is because when using RegisterStartupScript, the script still can't be guaranteed to run before initialization. And it will fail if the script uses any component that haven't been initialized yet.

But pageLoad function can be guaranteed to run after the page has been fully loaded and all components have been initialized.

So, it's a good practice to use pageLoad.

No comments:

Post a Comment