Page. response. Write ("response test ;");
Page. registerstartupscript ("registerstartupscript", "registerstartupscript test ;");
Page. registerclientscriptblock ("registerclientscriptblock", "registerclientscriptblock test ");
The location after response. Write output is in the first line of the source file.
The location after registerclientscriptblock is output is in the next line of <form> (under the scripts of Asp.net and some hidden fields ).
The location after registerstartupscript output is in the previous line of </form>.
The prototype of registerclientscriptblock is the same as that of registerstartupscript.CodeThe client script is sent immediately after the start mark of the element of the page object is generated. The registerstartupscript is sent before the end mark of the element of the page object. If your script has a statement that interacts with the Page Object (doucument object), we recommend that you use registerstartupscript. If you want to execute the client script as early as possible, you can use registerclientscriptblock or response. write.
Registerclientscriptblock generally returns the packaging of client functions, while registerstartupscript returns the functions that will be executed after the document is loaded, similar to the functions in the body onload = "F ()" that we usually call; the two methods have different code positions in the client. registerclientscriptblock is after <form runat = Server>, while registerstartupscript is before </form>.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/jianxue/archive/2008/03/31/2232289.aspx