我有以下控制器
[HttpPost]
public JsonResult Update(List<DeliveryNoteDisplay> DeliveryNotes, UserSession userSession)
{
// etc
}
这会正确地传递所有值,唯一的例外是 id 值始终为 null,即使我可以通过 fire bug 看到它。
public class DeliveryNoteDisplay
{
public virtual string Id { get; set; }
public virtual string ProjectId { get; set; }
public virtual string DeliveryNoteId { get; set; }
public virtual string ClientId { get; set; }
public virtual string VehicleId { get; set; }
public virtual string CourierId { get; set; }
public virtual string JobIds { get; set; }
public virtual string Name { get; set; }
public virtual string DeliveryTo { get; set; }
public virtual string DeliveryFrom { get; set; }
public virtual string Estimated { get; set; }
public virtual string Actual { get; set; }
public virtual string BookedDate { get; set; }
public virtual string CreatedByUserName { get; set; }
public virtual string Modified { get; set; }
public virtual string Created { get; set; }
public virtual bool ShowAddressFooter { get; set; }
public virtual bool ShowDeliveryFrom { get; set; }
public virtual bool ShowHeaderLogo { get; set; }
}