如何判断UpdatePanel回发中是否正在运行某个方法?

roh*_*agg 19 asp.net updatepanel asp.net-ajax scriptmanager

如何判断方法是否在AJAX回发的上下文中运行(即作为UpdatePanel(异步)回发的结果)?

根据egoldin Page.IsAsync是一个非常常见的混淆,与AJAX完全无关.

正确的方法是使用ScriptManager.GetCurrent(页面).IsInAsyncPostBack.

bar*_*tta 24

使用ScriptManager.GetCurrent(页面).IsInAsyncPostBack