I have asp.net mvc 5
project, which works fine in visual studio
. But when I publish it to iis 7.5
some of the ajax responses stopped not working and the console isn't writing anything.
var data = {};
data.Id = "12";
data.MemberId = $('').val();
data.Price = $('').val();
console.log(JSON.stringify(data)); // viewing correct json data
$.ajax(url, {
type: 'post',
cache: false,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
success: function (data) {
jsonObj = JSON.parse(data);
processing(jsonObj);
},
error: function (xhr, errorText) {
// don't call this function
console.log('Error ' + xhr.responseText);
},
})
but if send empty data (only var data = {}, without Id, MemberId), works fine.
UPD
[HttpPost]
public JsonResult MyAction (MyJsonObject jsonObject)
{ }
public class MyJsonObject
{
public int Id { get; set; }
public int MemberId { get; set; }
public double Price { get; set; }
}