When is the script added using RegisterStartupScript ()?

When is the script added to the page with Page.ClientScript.RegisterStartupScript () actually running? MSDN states "when the page finishes loading but before the page's" OnLoad "event is raised," but that's not much.

For example, can the script add with RegisterStartupScript assume the DOM tree has been built? Does the behavior of different versions of the browser differ and how?

+1


source to share


2 answers


Startup scripts are added at the bottom of the markup. Thus, they are processed automatically as the markup is loaded. I guess the exact implementation of this is browser dependent.



+1


source


The DOM tree must be created when running the startup scripts.



+1


source







All Articles