引用:html
using System.Web.Script.Serialization;
代碼:web
var resp = new {
flag = false,
url = ConfigReader.LogoutPage
};
JavaScriptSerializer serializer = new JavaScriptSerializer();
context.Response.Write(serializer.Serialize(resp));
總結:異步
JavaScriptSerializer 可讓咱們輕鬆序列化一個匿名對象,方便前臺經過Ajax異步方式獲取Json對象,進行處理,省去後臺拼接字符串的痛苦。url
出處:http://www.cnblogs.com/JavCof/archive/2011/05/12/2044524.htmlspa