title: Return result from PageMethods success function in Javascript
body: <p>I am successfully calling a PageMethod in Javascript from my C# code behind as follows.</p>
  
  <pre><code>PageMethods.getTextResume(sProfileID, function(result){alert(result);}, function(result){alert(result);});
  </code></pre>
  
  <p>The first parameter is the required parameter by the PageMethod on the code behind, and the next two parameters are success function and failure function respectively. That all works great, and the alert shows a message box with what I want. My question is how do I get that value in the current block of code I am in?</p>
  
  <p>I tried creating a global variable in JavaScript and setting that variable from the success/failure function, and oddly enough it works (only on second calls to that functions). There has to be an easier way to get the return value to the current block, something like</p>
  
  <pre><code>var sResults = PageMethods......
  </code></pre>
  
  <p>Help would be greately appreciated, thanks!</p>