public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; string tname = context.Request["Search"]; //Session验证用户是否存在 if (SessionHelper2.Get("username") == null && SessionHelper2.Get("password") == null) { context.Response.Redirect("Login.ashx"); } else { if (string.IsNullOrEmpty(tname)) { ShowList(context); } else { DataTable dt = new DataTable(); try { dt = SqlHelper.ExecuteDataTable("select * from teacher where tname like @tname", new SqlParameter("@tname", "%" + tname + "%")); } catch (Exception e) { } var Data = new { Persons = dt.Rows }; string html = CommonHelper.RenderHtml("TeacherMain.html", Data); context.Response.Write(html); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; SessionHelper2.Del("username"); SessionHelper2.Del("password"); context.Response.Redirect("Login.ashx"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; if (SessionHelper2.Get("username") == null && SessionHelper2.Get("password") == null) { context.Response.Redirect("Login.ashx"); } else { string html = CommonHelper.RenderHtml("main.html", " "); context.Response.Write(html); } }