1
我有一個ASP.NET WebService的返回列表的對象webservice的jQuery中返回集合類型
public class Students
{
public string StudentName { get; set; }
public int Age { get; set; }
}
我使用這個jQuery代碼
$.ajax({
type: "POST",
url: "/Students.asmx/GetStudents",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#myDiv").html(msg.d);
}
});
訪問此WebService但我得到的是對象對象。
如何獲取該對象中的數據?
由於重複這樣much..I忘了提,我使用jmsajax而不是$就..所以當我做什麼你suggest..i得到d.length爲空或不是對象。 – Musa 2009-05-19 12:54:36