<%@ WebHandler Language="C#" Class="javaScriptConvert.SerializeObject(list); break; case "getCompanyById": int cid = Convert.ToInt32(context.Session["cid"]); CompanyEntity company = CompanyBS.GetCompanyEntyById(1); message = JavascriptConvert.SerializeObject(company); break; case "insert": string condis = context.Request.Form["condi"].ToString(); ProductEntity model = (ProductEntity)JavaScriptConvert.DeserializeObject(condis, typeof(ProductEntity)); bool b = ProductBS.AddProduct(model); if (b) { message = "{success:true}"; } else { throw new Exception("商品添加失敗!"); } break; } context.Response.ContentType = "text/javascript"; context.Response.Write(message); } public bool IsReusable { get { return false; } } }
問了程序人生的站長(zhǎng),他說:
加上這句就好了:using System.Web.SessionState;
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注