public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int id; if (int.TryParse(context.Request.QueryString["id"], out id)) { customerBll customerBll = new customerBll(); if (customerBll.DeleteCustomer(id) > 0) { context.Response.Redirect("customerInfo.aspx"); } } else { context.Response.Write("参数错误~!"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int id = 0; if (int.TryParse(context.Request["id"], out id)) { customerBll customerBll = new customerBll(); if (customerBll.DeleteCustomer(id) > 0) { context.Response.Write("YES"); } else { context.Response.Write("NO"); } } }