ASP.Net Ajax的 - PageMethods同步调用和结果的检索 [英] ASP.Net Ajax - PageMethods Synchronous call and retrieval of results

查看:99
本文介绍了ASP.Net Ajax的 - PageMethods同步调用和结果的检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何ASP.Net Ajax的? - PageMethods同步调用和结果的检索

目前我在做下面的异步拨打和处理数据的:

Currently i am doing following async call and working with data :

function checkName(name) {
     PageMethods.IsAvailable(name, onSuccess);
}

function onSuccess(result, context, method) {
    //... do something with result ....
}

我如何能做到同样的同步与结果

推荐答案

恕我直言,这是不可能的ASP.NET AJAX,因为生成的包装使用异步调用。顺便说一句,你可以使用jQuery 致电PageMethod的它在哪里设置异步的问题:假

IMHO this is not possible with ASP.NET AJAX because the generated wrappers use async calls. By the way you could use jQuery to call the PageMethod where it is a matter of setting async: false.

这篇关于ASP.Net Ajax的 - PageMethods同步调用和结果的检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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