Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
Difference Between Page.ClientScript.RegisterStartupScript and Page.ClientScript.RegisterClientScriptBlock

Posted On: 22/12/2014 08:17:24

They both are used for same purpose but the differences between them are mentioned below:-

1) The method RegisterStartupScript adds Javascript to the web form right before the ending 'form' tag whereas the method RegisterClientScriptBlock adds Javascript to the web form, right after the starting 'form' tag .

2) The method RegisterStartupScript is used when you want to assign any value or property or want to get the value or property from any element whereas in case of the method RegisterClientScriptBlock we will get an error as 'object undefined'.

3) The method RegisterStartupScript holds the code which will run as soon as the browser parses it but the method RegisterClientScriptBlock holds routines and libraries that the whole page uses.

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us