解決方案
1、在Model的相關屬性上設定 [DisplayFormat(ConvertEmptyStringToNull = false)]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string id{ get; set; }
2、設定請求contentType為 application/json;
$.ajax({
type: "POST",
url: "#",
data:data,
dataType: "json",
contentType:"application/json;charset=utf-8",
success: function(data){
//do somthing...
}
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/38313.html
標籤:ASP.NET
上一篇:c# 陣列問題
下一篇:C#的實作FTP傳送檔案
