I want to create object on the client side of aspx page. And i want to add functions to these javascript classes to make easier the life.
Actually i can get and use the
Javascript side:
JSClass.prototype.fSaveToDB(){
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/WS/SaveObject.asmx/fSaveToDB"),
data: data: $.toJSON({ _obj: this }),
dataType: "json"
});
}
Web service is:
[WebMethod()]
public Student fSaveToDB(Student _obj)
{
return bla bla bla;
}