0

我的查询中有一个对象,现在我想将其转换为字符串,然后发送到我的 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();
4

1 回答 1

1

你在使用 JSON.parse(stringhere); 当您将序列化对象传递给您的页面时?

于 2013-08-27T21:06:25.110 回答