Hi there.
Handy examples:
http://www.dev102.com/2008/04/30/call-aspnet-webmethod-from-jquery/
http://www.dexign.net/post/2008/07/16/jQuery-To-Call-ASPNET-Page-Methods-and-Web-Services.aspx
I will give you a small example for the steps that should be taken.
First in your page you will put the calling of the web method:
var objectData; //Some variable you feel with the retrieved data
//function that calls your web method to retrieve the needed data.
getUsers: function() {
$.post("<%=ResolveUrl("~/GetUsers/")%>", //GetUsers is your web method
{
Date: '', //Fill here parameters needed by your web method
}, function(msg) {
objectData = msg;
});
}
Of course then you do with the data whatever you need to (Display, format etc.)
Then you have to write your web method. I am not going to write the method, just going to put an example.
//Code - (example is given in C#)
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Json)]
public string GetUsers(DateTime date) //date is the parameter you pass the web method with the json call
{
// Retrieve data
return ""; //return the desired result
}