$.ajax({
type: "POST",// Post 请求
data: { 'page': _page, 'id': id, "ccid": ccid },//需要传的参数
url: "/Web/AjaxLoadArticleMore",// 后台的方法
dataType: "json",// 采用json ,
success: function (info) {
if (info.length > 0) {
var _tmp_html = '';
$.each(info, function (x, y) {
alert(y.id);//弹出ID
});
} else {
alert("没有数据");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
lert(errorThrown);//出错啦!
}
});
PersonsDataContext db = new PersonsDataContext();
var res = new PersonsDataContext().persons.ToList();
var rs = from m in res
select new Person
{
id = m.id,
name = m.name,
classid = m.classid == null ? 0 : m.classid.Value,
classname = m.classinfo == null ? "" : m.classinfo.classname,
email = m.email,
sex = m.sex,
};
return rs;
}