public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int userId = Convert.ToInt32(context.Request["id"]); Bll.UserInfoBll userInfoBll = new Bll.UserInfoBll(); if (userInfoBll.DeleteUserInfo(userId) > 0) { context.Response.Write("ok"); } else { context.Response.Write("no"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; int id; if (int.TryParse(context.Request.QueryString["id"], out id)) { Bll.UserInfoBll userInfoBll = new Bll.UserInfoBll(); if (userInfoBll.DeleteUserInfo(id) > 0) { context.Response.Redirect("UserInfoList.aspx"); } else { context.Response.Redirect("Error.html"); } } else { context.Response.Write("参数错误"); } }