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