Can't seem to find a fix for this issue
I have the following code on the onclick event of an a html tag:
AddVacationToCart(
{
ServiceSupplier:'Kiki',
ProductId:'0;11968;0;0;187;1',
Name:'Excelsior',
NumberOfStars:'*****',
TotalPrice:'1620.00',
PriceLevelName:'Standard',
Currency:'EUR',
Status:'',
StartDate:'2010-06-17',
EndDate:'2010-06-24',
NumberOfNights:'7',
Rooms:[
{
NumberOfAdults:'2',
NumberOfChildren:'0',
ChildrenAges:[]
}
]
},'0;11968;0;0;187;1');return false;
I also have this code:
function AddVacationToCart(vacation, id) {
$.post("/ShoppingCart.mvc/AddVacation",
vacation,
function(data) {
var div = $("div[id*=cartv" + id + "]");
var removeFromCartHtml = "Adaugat";
$(div).html(removeFromCartHtml);
}, "json");
}
This is the code in my ShoppingCartController AddVacation Action:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult AddVacation(Vacation test)
{
...
}
The post works as in the (Vacation) test object gets filled with the corresponding properties like ServiceSupplier, ProductId, Name etc. Except the properties of my Rooms field do not get their corresponding values. Any ideeas?