Following is my relevant Code. I want to pass 2 Models to the POST Method.
How to pass 2 Models to Controller?
var mod1 = [], mod2 = [];
mod1.push({
Server: Server,
Name: Name
});
mod2.push({
POP: POPServer,
....
});
Settings = JSON.stringify({ 'Settings ': mod1 });
jq.ajax({
contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'POST',
url: '/Site/insertSettings',
data: Settings ,
success: function () {
....
}
});
Controller
[HttpPost]
public JsonResult insertSettings(Settings mod1, OtherSettings mod2)
{
....
}