Well, as I see it, you have problems with your ajax call. It should be:
$.ajax({ type: "POST", dataType: "json", contentType: "application/json; charset=utf-8", url: "Soap-Service.aspx/SaveUser", //Here you got wrong method //right here you should pass object (not string) with right property names (like you have in your web method) data: { FName: Name, LNAme: LName, Company: Company}, success: function (Record) { $('#txtName').val(); $('#txtlName').val(); $('#txtCompany').val(); if (Record.d == true) { $('#Result').text("Your Record insert"); } else { $('#Result').text("Your Record Not Insert"); } }, error: function (textMsg) { $('#Result').text("Error: " + Error); } });
Above your web method you should add:
[WebInvoke(Method="POST",ResponseFormat=WebMessageFormat.Json)]
source share