Both RegisterClientScriptBlock & RegisterStartupScript can be used to register script in web page. However script registered through "RegisteredClientScriptBlock" method will be rendered before any page elements rendered, where as script registered through "RegisterStartupScript" will be rendered once the page elements are rendered.
So, in former case if your script use any form elements, then it will not work because form elements haven't been instantiates yet. In later case, if your script use any element attribute like click, onmouseover etc, it will work fine.
Microsoft .NET Tips · · · ·
Thanks kirti for great post....