我的查询中有一个对象,现在我想将其转换为字符串,并发送到我的json页面,但我得到[object object], [object object]
我的查询是:
using System.Web.Script.Serialization;
public partial class AjaxProcess : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SouthParsModel.SouthParsEntities db = new SouthParsModel.SouthParsEntities();
JavaScriptSerializer js = new JavaScriptSerializer();
string serText = "";
int id = Convert.ToInt32(Request["get_subcategory_or_product_of_this"]);
var CatList = from rows in db.Categories
where rows.parentid_FK == id
select new { rows.id, rows.name, Type = "category"};
Response.Write(serText);
Response.End();
答案 0 :(得分:1)
您使用的是JSON.parse(stringhere);将序列化对象传递给页面时?