statusJson sj = new statusJson()
{
ShipmentNum = "555555",
Status1 = "05",
Warehouse = "SHANGHAI",
Company = "AAA"
};
List<statusJson> sjlist = new List<statusJson>()
{
new statusJson()
{
ShipmentNum = "555557",
Status1 = "200",
Warehouse = "SHANGHAI",
Company = "AAA"
},
new statusJson()
{
ShipmentNum = "555558",
Status1 = "200",
Warehouse = "SHANGHAI",
Company = "AAA"
}
};
string getJson = SerializationHelper.ObjecttoJson(sjlist);
public string UpdateStatus(string getJson)
{
List<statusJson> strstatus = JavaScriptHelper.JSONtoObject<List<statusJson>>(getJson);
try
{
foreach (statusJson st in strstatus)
{
string oldstatus = "";
string newstatus = st.Status1;
string restatus = reStatus(newstatus);
string Shipment_ID = st.ShipmentNum;
}
}
}
Newtonsoft.JSON.dll
引入項目中,導入命名空間
JObject json=JObject.Parse(jsonstring);
取值=json[“name”].Value<string>();//多個的話請用循環取值
你的json格式不對吧,如果正確的話alert(data.list)這個應該是會輸出一些東西的,類似這種"[object object]"
undefined的意思是你未定義