Monday, July 20, 2009

whats the Difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript

The RegisterClientScriptBlock method inserts the client-side script immediately below the opening tag of the Page object's
element. Form elements at this stage are not instantiated, so the code cannot access the form elements.

The RegisterStartupScript method inserts the specified client-side script just before the closing tag of the Page object's
element. Form elements at this stage are instantiated, so the code can access the form elements.


No comments: