I am calling a specific WebMethod from client side like this:
function openSmallPopup(int) {
PageMethods.GetTenantInfo(int, OnGetMessageSuccess, OnGetMessageFailure);
return 'I need here to return the result';
}
function OnGetMessageSuccess(result, userContext, methodName) {
alert(result);
}
Well, the result is successfully displayed in OnGetMessageSuccess. The single problem is that I really need to return that result in the initial openSmallPopup method…Do you guys know any way to do this?
Why you want to that?? If you really want to do that then have to call initial function from OnGetMessageSuccess with result parameter and modify signature of initial function.
But in practice i would rather take out that code from openSmallPopup into seperate function and call it in callback.