I have POST function and i need to send from JS to Controller my values. String and integer values reaching without problem but double values is not reaching on server side but when i try on my local side it's working. Why it's acting like this?
Here my JS and Controller codes
var cmbvdf = $('#cmbvolDec').data('kendoComboBox');
var cmbvdfval = cmbvdf.value();
var cmbadf = $('#cmbamtDec').data('kendoComboBox');
var cmbadfval = cmbadf.value();
var cmbCur = $('#cmbCurrency').data('kendoComboBox');
var cmbcurrency = cmbCur.value();
var cmtheme = $('#cbmTheme').data('kendoComboBox');
var cmbvaltheme = cmtheme.value();
var cmblang = $('#cmbLanguage').data('kendoComboBox');
var cmbvallang = cmblang.value();
var custname = $("#txtCustName").val();
var websitetitle = $("#txtWebName").val();
var zoom = $("#txtZoom").val();
var lat1 = $("#txtLat1").val();
var lon1 = $("#txtLon1").val();
var url = '../Setting/SaveRecords';
$.ajax({
type: "POST",
url: url,
data:JSON.stringify({ 'volumeDecimalFactor': cmbvdfval, 'amountDecimalFactor': cmbadfval, 'currency': cmbcurrency, 'theme': cmbvaltheme, 'language': cmbvallang, 'customerName': custname, 'lat1': lat1, 'lon1': lon1, 'web': websitetitle, 'zoom': zoom }),
contentType: 'application/json, charset=utf-8',
traditional: true,
success: function (data) {
//do something
}
});
Here is my C# Controller
public ActionResult SaveRecords(string volumeDecimalFactor, string amountDecimalFactor, string currency, string theme, string language, string customerName, double? lat1, double? lon1, string web, double? zoom)
{
//when i'm on my local machine i can get double values without problem.
//when i published on server i cannot get values and return to me null!
}
EDIT
Here is Request Payload from Google Chrome Network Tab
amountDecimalFactor: "2"
currency: "4"
customerName: "Fuel Card System"
language: "1"
lat1: "41.071789"
lon1: "28.980325"
theme: "4"
volumeDecimalFactor: "2"
web: "WebProject"
zoom: "5.2
Note that my local PC and Server is in different countries.