Apr 13th, 2012

Here is a simple way to create a helper function to wrap an JQuery.ajax method using an options object to override settings. I also included a wrapper to setup a JQuery UI confirmation dialog box in the Common JQueryHelper namespace.

Here is a quick example of how you might levarge the wrapper. Given a web service, CxServices.asmx calling GetMessages web method passing in a psUserId parameter get back a array of JxMessage JSON objects.

[WebMethod(true)]publicstringGetMessages(stringpsUserId){List<JxMessage>messages=newList<JxMessage>();// .... do some logic like get the message list// Send it back as JSONreturnCxJSONHelper.Serialize(messages);}