hi guys i'm posting some data to controller using jquery ajax, but i am getting null values in my controller,
jQuery code is:
$('#registerCompOff').click(function() {
    var compOff = [];
    $('div').each(function() {
        var curRow = {};
        curRow.Description = $(this).find('.reason').val();
        curRow.CompOffDate = $(this).find('.datefieldWithWeekends').val();
        if (curRow.Description != null && curRow.CompOffDate != null) {
            compOff.push(curRow);
        }
    });
    $.ajax({
        type: 'POST',
        url: this.href,
        dataType: 'json',
        data: compOff
    });
    return $('form').valid();
});
compOff is not null I have checked that...
controller is:
 [HttpPost]
        public ActionResult RegisterCompOff(RegisterCompOff[] registerCompOff)
        {
            //return View();
        }
can you tell me where i'm going wrong?
data: JSON.stringify(compOff)then addcontentType: "application/json; charset=utf-8"and finally change parameter name of action controller topublic ActionResult RegisterCompOff(RegisterCompOff[] compOff). Model binding should kick off then. It did for me.