I want to send FormCollection to Ajax function.
So this is my Ajax function
function checkProductAttribute(productVariantId)
{
var form = $("product-details-form").serialize();
$.ajax({
cache:false,
type: "POST",
dataType: 'html',
url: "@(Url.Action("CheckProductVariantToCart", "ShoppingCart"))",
data: { "productVariantId": productVariantId, "shoppingCartTypeId": 1, "form": form },
success: function (msg) {
if(msg == 'true' )
{
returnVal = true;
}
else
{
returnVal = false;
}
},
error:function (){
returnVal = false;
alert("fail");
}
});
return true;
}
And this is my controller
public bool CheckProductVariantToCart(int productVariantId, int shoppingCartTypeId, FormCollection form)
{
//Somthing here
return true;
}
my problem is -How to sent FormCollection thought the Ajax function?