You might want to look into using jQuery for a client side JavaScript library. It makes it pretty easy to pull data from ASMX/WCF services created in .NET. You can return the data in a variety of ways XML/JSON and easily manipulate the page using jQuery DOM selectors!
Here is a simple call to load some JSON data via ASMX service.
$.ajax({
type: "POST",
url: "demo.asmx/GetData",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{q:'a', limit: 10}", // Passing params to function!
success: function(res) {
// Do your work here.
// Remember, the results for a ASMX Web Service are wrapped
// within the key "d" by default. e.g. {"d" : "Hello World"}
}
});
And here is an example ASMX service returning a LIST, which really could have been anything. If you already have strongly typed POCO objects, you can probably probably already serials your data using a similar method. There is also the JSON.NET library that will allow you to serialize an entire DataTable.
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class Autocomplete : System.Web.Services.WebService
{
[WebMethod]
public List<string> GetData(string q, int limit)
{
// A collection to hold our results
List<string> customers = new List<string>();
// Our source of names, could be a DB query
string[] db = new string[]{"Amy","Betty","Brent","Fred","Mark","Sally","Sam","Richard","Wilma","Yolanda","Zack"};
// Looping through the datasource to select the items that match
foreach(string cust in db)
{
if(cust.ToLower().Contains(q.ToLower()))
{
customers.Add(cust);
}
}
// Sort the list
customers.Sort();
// Return the items that contained the text in alphabetical order
return customers;
}
}
Lots of things you can do and there are lots of people writing about using these technologies. If you just starting, you should probably look at WCF since it's the successor to ASMX services!