Wednesday, March 23, 2016

Call Webmethod using Json

function JsoncallResult() {
                var Result = "";
                var params = { PatientID: PatientID, LocationID: LocationID, TransDate: TransDate };

                $.ajax({
                    type: "POST",
                    url: "/DesktopModules/DMS/JsonCalls.aspx/GetPatient",
                    data: JSON.stringify(params),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: false,
                    cache: false,
                    success: function (data) {
                        Result = data.d; 
                    },
                    error: function (result) {
                        alert('error occured');
                        alert(result.responseText);

                    }

                });
               return Result;
            }

No comments:

Post a Comment