How to Pass a Model in MVC Jquery AJAX call?
I got this simple solution from stackoverflow and it worked for me.
Model:
Controller:
script in View:
|
However if your Action is not called or model is not passed then try this.
$.ajax({
url: '/home/check',
type: 'POST',
data: {
Address1: "423 Judy Road",
Address2: "1001",
City: "New York",
State: "NY",
ZipCode: "10301",
Country: "USA"
},
contentType: 'application/json; charset=utf-8',
success: function (data) {
alert(data.success);
},
error: function () {
alert("error");
}
});
Comments
Post a Comment