I have following jQuery code and it works fine and I am able to deserialize it in the server properly.
But when I tried to create a variable and pass that as a JSON obje
Your commented code passes a different object to the non-commented code
Commented data (non-working):
{
searchCriteria: {
Accrual: "A",
Brand: "B"
}
}
Uncommented data (working):
{
Accrual: "A",
Brand: "B"
}
the original commented ajax request should be:
$.getJSON(url, searchCriteria, function (data) {
if (data.length) {
alert('Success');
}
});