You are not using AJAX, even in the slightest, most liberal definiation. AJAX is an out of band call, there is no postback involved. You should spend some time reading up on AJAX and its usage if you want to be doing web development.
function AjaxCall()
{
$.ajax({
type: "POST",
url: "foo.aspx/Bar",
data: "text=" + $("[id$='myText']").text(),
success: onSuccess
});
}
function onSuccess(data)
{
$("#myResults).text(data);
}
[WebMethod()]
public static string Bar(string text)
{
// DO something
return "something";
}
ALso make note of code snippets are properly formatted. Now you try.
I know the language. I've read a book. - _Madmatt