2014-09-15 2 views
-3

json.Values의 값은 'null'입니다. 문제가있는 곳은 어디입니까? Mvc에서 JSON 객체에서 값을 가져올 수 없습니다.

MY : JQUERY CODE IN siparis.cshtml

var array_table = []; 
array_table.push({ 
    arrayName: "Name Value", 
    arrayMail: "Mail Value", 
    arrayMobile: "mobile Value" 
}); 
} 

$.ajax({ 
    url: '@Url.Action("SiparisOlustur")', type: "POST", dataType: "json", 
    data: JSON.stringify(array_table), 
    type: 'POST', 
    contentType: "application/json; charset=utf-8", 
    success: function (data) { 
    $('#POCStatus').html('<div class="success">POC Removed Successfully.</div>'); 
    }, 
    error: function() { 
    $('#POCStatus').html('<div class="field-validation-error">Some Error Occured in Removing POC.</div>'); 
    } 
}); 

내 JSON 모델 :

public class JsonModel 
{ 
    public string arrayName { get; set; } 
    public string arrayMail { get; set; } 
    public string arrayMobile { get; set; } 
} 

내 SiparisController :

ARRAY_TABLE은 :

[HttpPost] 
public ActionResult SiparisOlustur(List<JsonModel> array_table) 
{ 
    return View(); 
} 

결과 이쪽 다가오는 NUL L

감사합니다, 감사합니다, B.Y.

답변

0

아약스 호출에서 데이터 array_table 이름을 지정 등 :

data: {array_table : JSON.stringify(array_table)} 
관련 문제