json not passing thru id on mvc 3 controller
-
03-06-2021 - |
Question
I have the following controller
[HttpPost]
public JsonResult Update(List<DeliveryNoteDisplay> DeliveryNotes, UserSession userSession)
{
// etc
}
This passing thru all of values correctly with the one exception that the id value is alway null even though i can see it via 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; }
}
Solution
In the post the json starts with Id with a value and ends with id again... there it's empty.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow