Код: Выделить всё
public class PreventivoDS
{
public int Id { get; set; }
public string? CodPreventivo { get; set; }
public string Data { get; set; }
public int Durata { get; set; }
public int IdCliente { get; set; }
public string Cliente { get; set; }
public string Descrizione { get; set; }
public string Oggetto { get; set; }
public int IdCondizionePagamento { get; set; }
public string CondizionePagamento { get; set; }
public decimal CostoSpedizione { get; set; }
public bool? Accettazione { get; set; }
public string? DataRisposta { get; set; }
public IFormFile FilePreventivoAccettato { get; set; }
public List
PreventivoArticoloDettaglio { get; set; }
public List PreventivoPagamento { get; set; }
}
Код: Выделить всё
public class PreventivoArticoloDettaglioDS
{
//CODE HERE
}
Код: Выделить всё
public class PreventivoPagamentoDS
{
//CODE HERE
}
Код: Выделить всё
[HttpPost]
public async Task AddEditPreventivo([FromForm] PreventivoDS p)
{
//CODE HERE...
}
Код: Выделить всё
$.ajax({
url: '/Preventivi/AddEditPreventivo',
data: formData,
type: "POST",
contentType: false,
processData: false,
beforeSend: function (event) {
loadingPage("Attendere!!! Salvataggio Preventivo in Corso...");
},
success: function (mydata) {
.....
},
complete: function (event, jqXHR, ajaxOptions) {
$.unblockUI();
},
error: function (xhr, ajaxOptions, thrownError) {
}
});
});
Когда данные передаются на сервер, основной объект PreventivoDS всегда имеет пустые списки
когда ajax передает объект formdata в серверную часть, внутри объекта находятся все данные, кроме двух списков, которые всегда содержат нулевые записи. Кто может мне помочь?
Подробнее здесь: https://stackoverflow.com/questions/789 ... net-core-8