Differences between ScriptManager and ClientScript when using JS?

Can someone explain to me what are the differences between ScriptManager and ClientScript?

ClientScript works well when I use it in the Button_Clicked event, but it does not work when I use it in the GridView_RowUpdated from the GridView. (GirdView wrapped inside the update panel). Then I tried ClientScript, and in this case it worked perfectly.

+6
source share
1 answer

You have largely identified the main difference. ScriptManager is intended for use with async postbacks, so it works with UpdatePanel. The ClientScript class is for synchronous postbacks. So, if you are going to send messages from UpdatePanel, be sure to use ScriptManager instead of ClientScript.

Scriptmanager

+10
source

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


All Articles