ContentType出力のタイプが大文字と小文字を区別するかどうかを制御します
1221 ワード
例:
context.Response.ContentType = "application/json";
context.Response.ContentType = "application/Json";
同じですか?
本来は全く問題のないコードを実行し、フロントコード:
$.ajax({ type: "post",
url: urlAjax + "?OperationType=add",
data: $(formId).serialize(),
success: function (msg) {
var obj = jQuery.parseJSON(msg);
if (obj.IsSuccess == true) {
$.messager.alert(' ', obj.Msg,'info',SaveOkCallback);
}
else {
$.messager.alert(' ', obj.Msg);
}
EnableButton(true);
}
});
バックグラウンドコード:
context.Response.ContentType = "application/Json";
バックグラウンドコードを
context.Response.ContentType = "application/json";
ということで、フロント直送が間違っていました!!この一言です!!
jQuery.parseJSON(msg)
IsSuccess属性はありません!!!
最終的に判明した原因はなんと大文字と小文字の問題によるもの!!
ContentTypeは大文字と小文字を区別しているようですが、関連資料が見つかりません!!