哪些类型可以转换为json。(SqlDataReader,DataSet,List)?
前台js$(function(){$table=$("<table></table>");$.getJSON("Handler1.ashx",function(data)...
前台js
$(function(){
$table=$("<table></table>");
$.getJSON(
"Handler1.ashx", function(data){
$.each(eval(data),function(i,item){
alert(item.id);
})
}
)
})
一般处理程序中:
context.Response.ContentType = "text/plain";
JavaScriptSerializer serializer = new JavaScriptSerializer();
SqlDataReader reder = bll.Getlist("select * from R_ProductInFreightSpace");
context.Response.Write(serializer.Serialize(reder)); 展开
$(function(){
$table=$("<table></table>");
$.getJSON(
"Handler1.ashx", function(data){
$.each(eval(data),function(i,item){
alert(item.id);
})
}
)
})
一般处理程序中:
context.Response.ContentType = "text/plain";
JavaScriptSerializer serializer = new JavaScriptSerializer();
SqlDataReader reder = bll.Getlist("select * from R_ProductInFreightSpace");
context.Response.Write(serializer.Serialize(reder)); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询