ASP.Net Ajax - PageMethods Synchronous call and retrieval of results

北战南征 提交于 2019-11-30 19:10:17

问题


How to ASP.Net Ajax - PageMethods Synchronous call and retrieval of results ?

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 ....
}

How can i do same synchronously with result?


回答1:


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.



来源:https://stackoverflow.com/questions/1957600/asp-net-ajax-pagemethods-synchronous-call-and-retrieval-of-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!