Tuesday, 27 August 2013

serialize and get object object

serialize and get object object

I have an object from my query, now i want convet it to string, and send
to my json page, but i get [object object], [object object] please help
me. my query is:
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();

No comments:

Post a Comment