Rini

Rini

  • 1.5k
  • 204
  • 31.8k

MVC

Jul 7 2015 7:17 AM
user model is not posting the values in controller in jquery
My code is
function btnAddItems() {
var VOUCHERNO = $('#txtPVocherNo').val();
var DDATE = $('#txtDate').val();
var TXNMODE = $('#cmbMode').val();
var BYLEDGER = $('#txtPayment').val();
var TOLEDGER = $('#txtPaidBy').val();
var AMOUNT = $('#txtAmount').val();
var NARRATION = $('#txtNarration').val();
var UserModel =
{
"VOUCHERNO": VOUCHERNO,
"DDATE": DDATE,
"TXNMODE": TXNMODE,
"BYLEDGER": BYLEDGER,
"TOLEDGER": TOLEDGER,
"AMOUNT": AMOUNT,
"NARRATION": NARRATION
};
$.ajax({
url: '../ReceiptPayment/DepositGrid/',
data: JSON.stringify(UserModel),
type: 'POST',
contentType: 'application/json; charset=utf-8',
success: function (data) {
$("#itemfilldiv").html(data);
}
});
}
 
 and my Model code is
------------------------------------ 
public string VOUCHERNO { get; set; }
public DateTime DDATE { get; set; }
public string TXNMODE { get; set; }
public string TXNTYPE { get; set; }
public string BYLEDGER { get; set; }
public string TOLEDGER { get; set; }
public string DBTXNNO { get; set; }
public string BYLEDGERID { get; set; }
public string AMOUNT { get; set; }
public string NARRATION { get; set; }
public string TOLEDGERID { get; set; }
public string TOBANK { get; set; }
public string TOCHQNO { get; set; }
public DateTime TOCHQDATE { get; set; }
public int DEPARTMENTID { get; set; }
public int FINYEARID { get; set; }
public int BRANCHID { get; set; }
public string GridOp { get; set; }
public int SI_SlNo { get; set; }
public int CompanyId { get; set; }
public int BranchId { get; set; }
public int yearId { get; set; }
public string ACCOUNTCODE { get; set; }
public string ACCOUNTHEAD { get; set; }
public string BankGroup { get; set; }
public string Cashgroup { get; set; }
 
 

Answers (3)