你怎么能知道一个方法是在回发的UpdatePanel中运行? [英] How can you tell if a method is being run in UpdatePanel postback?

查看:207
本文介绍了你怎么能知道一个方法是在回发的UpdatePanel中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何辨别的方法是在AJAX回发的(即作为UpdatePanel的(异步)回发的结果)?

How can I tell if a method is running in the context of an AJAX postback (i.e as the result of a UpdatePanel (asynchronous) postback)?

据<一个href=\"http://msmvps.com/blogs/egoldin/archive/2008/05/21/how-to-tell-the-page-is-in-ajax-call.aspx\">egoldin Page.IsAsync是具有绝对无关,与AJAX一个非常普遍的混乱。

According to egoldin Page.IsAsync is a very common confusion that has absolutely nothing to do with AJAX.

正确的做法是用ScriptManager.GetCurrent(页).IsInAsyncPostBack。

The correct approach is to use ScriptManager.GetCurrent ( Page ).IsInAsyncPostBack.

推荐答案

使用ScriptManager.GetCurrent(页).IsInAsyncPostBack

Use ScriptManager.GetCurrent ( Page ).IsInAsyncPostBack

这篇关于你怎么能知道一个方法是在回发的UpdatePanel中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆