Aghil Varghese

Aghil Varghese

  • NA
  • 61
  • 12k

How to pass model and id using ajax call

Aug 5 2015 7:41 AM
How to get the data using ajax call containing model and rowFeeId together in controller.when i am using this function i am getting the model but the rowFeeId is null.
 
 
Ajaxcall
 
function DeleteFee(_this) {
var par = $(_this).closest('tr');

var rowFeeId = par.find('.RowFeeId').val();
$.ajax({
url: '@Url.Action("DeleteInvoiceFee", "Invoice")',
dataType: "Html",
type: "POST",
traditional: true,
data:{ 'RowFeeId': rowFeeId, 'model': $('#FormSubmitInvoice').serialize() },
success: function (result) {
// alert(result);
$('#addFeedetailsSection').html(result);
},
error: function (xhr) {
alert('error');
}
//dataType :
})
}
 
controller 
 
public ActionResult DeleteInvoiceFee(InvoiceViewModel model,string RowFeeId)
{
................

Answers (2)