1. 程式人生 > >返回json

返回json

json response text javascrip 返回json ejs void ria info

private void WriteJson(object o)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
Context.Response.ContentType = "text/json";
string str = serializer.Serialize(o);
logger.Info(" 結果: " + str);
Context.Response.Write(str);
Context.Response.End();
}

返回json