I am calling a Web Method in the code behind with a Method Signature that has 4+ strings accepted. I am creating a params variable and using it to add all input fields I want to pass to the method.
var params = {
showStartDate: showStartDate,
showEndDate: showEndDate,
arrivalDate: arrivalDate,
pickUpDate: pickUpDate
};
How do I then pass "params" in my AJAX call? Below is my current code which does not seem to be working. I don't want to have to pass each param explicitly in the data section.
$.ajax({
type: "POST",
url: "OrderSummary.aspx/JSONUpdateOrder",
async: false,
data: "{'" + params + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
}
});