且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AJAX 方法调用中的 RegisterClientScriptBlock

更新时间:2023-12-05 23:33:58

对于启用 AJAX 的页面,您应该使用 ScriptManager 来注册脚本:

With AJAX enabled pages, you should use the ScriptManager to register scripts:

ScriptManager.RegisterClientScriptBlock(Page, typeof(MyPage), 
    "MyScript", "GoStuff()", true)

您可以使用它来注册所有脚本(原始加载、回发、AJAX 回发).

You can use this to register all your scripts (Original load, postback, AJAX postback).