Author: r_honey | Posted on: 4/5/2010 3:07:44 PM | Views : 239

Here's one of my web methods:
[WebMethod] [ScriptMethod] public void getClients (string profileNum, string firstName, string lastName) { List<object> l=new List<object>(); context.Response.ContentType = "text/json"; int n= base.performSearch(new Client.DataProvider().getClientsBy(profileNum, firstName, lastName), delegate(Client c) { l.Add(new { c.profileId, c.profileNum, c.fullName, c.email }); }); this.Context.Response.Write(string.Format("{{total:{1},'data':{0}}}", base.serializer.Serialize(l), n)); try { this.Context.Response.Flush(); this.Context.Response.Close(); } catch (Exception) { } }

And here's a raw output of this call captured from Fiddler:
HTTP/1.1 200 OK Date: Mon, 05 Apr 2010 18:57:58 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET ...

Go to the complete details ...