$.ajax({
type: 'POST',
url: '@Url.Action("SetDisplaySettings", "DisplaySettings")',
data:$('#Form1').serialize(),
success: function (result) {
$('#chkIsSystemDefault').prop('checked', false);
if(result=="2"){
showAlertBox("Display Settings updated.");
}
}
});
もう1つのパラメータCountryId
を渡す必要があります。これどうやってするの?ajaxでもう1つパラメータを渡すには?
data:$('#Form1').serialize()+ '&CountryId=' + CountryId,
それとも - :
$.ajax({
type: 'POST',
url: '@Url.Action("SetDisplaySettings", "DisplaySettings")',
data:{
form : $('#Form1').serialize(),
other : ...
},
success: function (result) {
$('#chkIsSystemDefault').prop('checked', false);
if(result=="2")
{
showAlertBox("Display Settings updated.");
}
}
});
多分 'データのようなもの:{データ:$( '#、Form1を')(シリアライズ)、countryId:CountryIdを}、' –