Here is my Ajax function:
function createSalesInvoice() {
var SalesInvoice = {};
SalesInvoice.PaidAmount = $("#textbox1").val();
SalesInvoice.RemainingAmount = $("#textbox2").val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/AjaxRequestToServer.aspx/createSalesInvoice", //URI
data: '{SalesInvoice: ' + JSON.stringify(SalesInvoice) + '}',
dataType: "json",
success: function (data) {
bootbox.alert("Item Added Successfully", function (e) { });
GetSalesInvoiceItemsList();
$("#hdfFlag").val("false");
},
error: function (xhr) {
}
});
}
I can't call my [webmethod]
. all values from textbox returns correct. I want to insert those values in table.
[WebMethod]
public static int createSalesInvoice(SalesInvoiceEntity SalesInvoice)
{
int i = SalesInvoiceManager1.createSalesInvoice(SalesInvoice);
return i;
}