Not getting data in Web service through json

AZImagined

New Member
\[code\] var questionOptionArray=[{"questionCode":"1111111177","optionCode":"1111111147"}, {"questionCode":"1111111103","optionCode":"test"},{"questionCode":"1111111104","optionCode":"1111111212"},{"questionCode":"1111111105","optionCode":"1111111215"},{"questionCode":"1111111106","optionCode":"test2"}] var jsonobj = JSON.stringify(questionOptionArray); alert(jsonobj); $.ajax({ type: "POST", url: "Services/Quiz.asmx/InsertUserQuiz", data: JSON.stringify({ questionOptionArray: questionOptionArray }), contentType: "application/json; charset=utf-8", dataType: "json", success: function(data) { alert(data); }, failure: OnError }); }\[/code\]in quiz.asmx my code:\[code\]public class Quiz : System.Web.Services.WebService { public class optionDetail { string questionCode { get; set; } string optionCode { get; set; } } [WebMethod] public string InsertUserQuiz(List<optionDetail> questionOptionArray) { var count = questionOptionArray.Count(); return "1"; } }\[/code\]i am getting null value of questionOptionArray with five count.,how to get values of questionCode ,optionCode in web service so that i caninsert them in database.
 
Back
Top