What is the difference between ScriptManager.RegisterStartupScript () and ScriptManager.RegisterClientScriptBlock (), how do both do the same?

Hi I am just wondering why some people suggest RegisterStartupScript () to call client side js, while some offer RegisterClientScriptBlock ().

Please let me know what is the difference between them when they perform the same operations for using js operator calls, and which one is preferable if I use only js commands, such as alert, return confirm from codebehind.

+3
source share
1 answer

RegisterClientScriptBlock script <form runat="server">. - , .

RegisterStartupScript script <form runat="server">. , . , , "", , script .

RegisterClientScriptBlock, js- RegisterStartupScript, .

. MSDN.

+15

Source: https://habr.com/ru/post/1786624/


All Articles