我有这样的结构
public class CJsonFeatureQuestion
{
public string QuestionName { get; set; }
public string Url { get; set; }
}
public class CJsonFeatureProps
{
public string FeatureName { get; set; }
public string IsActive { get; set; }
public string Url { get; set; }
public List<CJsonFeatureQuestion> FeatureQuestion;
public CJsonFeatureProps()
{
FeatureQuestion = new List<CJsonFeatureQuestion>();
}
}
并在以下帮助下将其发送到转换为 json
JavaScriptSerializer
将其更改为 json。
它会工作还是不工作。我无法遍历 jquery 中的内部集合。
更新 1
success: (function Success(data, status) {
$("#loading").hide();
for (var i = 0; i < data.length; i++) {
var innerData = data[i];
for (var j = 0; i < innerData.length; j++) {
}
}
}),
innerData
是object Object
,但长度未定义。
更新 2
jQuery 调用
contentType: "application/json; charset=utf-8",
dataType: "json",