Can someone please tell me how I can invoke a ASP.NET codebehind method from client-side JavaScript?
Thanks
Use jQuery AJAX , This is good source
$.ajax({
type: "POST",
url: "MessagePopup.asmx/SendMessage",
data: "{subject:'" + subject + "',message:'" + message + ",messageId:'" + messageId + "',pupilId:'" + pupilId +"'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Do something interesting here.
}
});
If you want just using JavaSctipt without using jQuery fallow this links