Differences between ScriptManager and ClientScript when used to execute JS?

前端 未结 1 357
庸人自扰
庸人自扰 2020-12-07 01:46

Can somebody explain for me what the differences are between ScriptManager and ClientScript?

ClientScript works well when I use it in Button_Clicked event, but it do

相关标签:
1条回答
  • 2020-12-07 02:05

    You've pretty much identified the primary difference. The ScriptManager is meant to be used with async postbacks, which is why it works with the UpdatePanel. The ClientScript class is for synchronous postbacks. So, if you're going to be posting back from an UpdatePanel, be sure to use the ScriptManager instead of ClientScript.

    ScriptManager

    0 讨论(0)
提交回复
热议问题