Javascript calls to an Ajax WebMethod. How to get multiple output params returned?
- by George
OK, I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way.
Here's how I return a single function result. How do I return multiple output values?
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
</Services>
function CallHelloWebMethod() {
WebService.Hello(OnComplete1, OnTimeOut, OnError);
}
function OnComplete1(arg) {
alert(arg);
}
function OnTimeOut(arg) {
}
<WebMethod()> Public Function Hello(ByVal x As String) As String
Return "Hello " & x
End Function