JSON is undefined - Jquery results stops working
hi guys
I have this ajax post which worked when I used test values
However on changing it to real meaningful values (e.g I used my family names as return values) After changing it to (Output, SQuantity, Output and total) it stopped working. Here is my code below
please advise
- function ehi(e) {
- var fd = new FormData($("#Shops")[0]);
- $.ajax({
-
- type: "POST",
- url: "/Shopping_Basket/Shop_AddToBasket", //
- contentType: false,
- processData: false,
- data: fd,
- success: function (message) {
-
- $('#Ok').show();
- $('#list').show().html(message.MyStatus + ' ' + message.SQuantity + ' ' + message.Output + ' ' + message.Total);
- },
- error: function (message) {
- }
- });
- /// and on the server side
- public async Task<ActionResult> Shop_AddToBasket(Duo_Basket_and_Products model)
- {
- var message = new { MyStatus = "0", SQuantity = "1000", Output ="Success", Total = "test"};
- return Json(message);