'__pendingCallbacks[...].async' is null or not an object
是在对一个控件添加Callback功能的时候出现的这个问题,后来查询资料,解答如下:
I was doing so ASP.Net 2.0 callbacks (see an overview here: http://dotnet.sys-con.com/read/192509.htm), and kept getting this error when I did a document.location redirect on the ReceiveCallback JavaScript function.
Microsoft JScript runtime error: '__pendingCallbacks[...].async' is null or not an object
Looks like a flagrant Microsoft bug: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101974
People have different suggestions
- http://developers.de/blogs/damir_dobric/archive/2006/03/02/4.aspx?Ajax_CallBack=true
- http://blogs.sqlxml.org/bryantlikes/archive/2005/12/20/4593.aspx
What worked for me is the setTimeout. However, I needed to pass a parameter to the variable, so I used a technique like so:
var _gRValue;
function ReceiveCallback(rValue)
{
_gRValue = rValue;
window.setTimeout('__ReceiveCallback(_gRValue)',0);
}
function __ReceiveCallback(rValue)
{
//Do stuff here
} //end of method
To handle the nature of setTimeout, I stored the returned data in a member variable.
根据该提示,我将客户端回调中的函数变量i改为其他的就OK了, window.setTimeout这个方法我没试。