C# 序列化并获取对象

C# 序列化并获取对象,c#,asp.net,json,webforms,C#,Asp.net,Json,Webforms,我的查询中有一个对象,现在我想将其转换为字符串,并发送到我的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) { So

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

您正在使用JSON.parse(stringhere);将序列化对象传递到页面时?

我的问题是C#(asp.net编程),用于序列化!我不明白你的问题,你从什么中得到
[object object]
,你希望得到什么?你能提供serText中的字符串和你希望得到的吗?除了通知我们你正在使用webforms之外,提交的代码似乎与问题无关。我很困惑。您的JSON看起来像什么?如何提交?您是如何尝试反序列化它的?“成功:函数(msg){if{data=eval(“+msg+”);警报(data);var temp=$(“#dvCategory”).html();var(u output=“”;for(var i=0;i