<%@ WebHandler Language="C#" Class="getxxtx" %> using System; using System.Web; using System.Data; using System.Data.SqlClient; using System.Web.SessionState; public class getxxtx : IHttpHandler,IRequiresSessionState { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(HttpContext.Current.Session["user"]); string cmd = "select count(*) from view_nr_z_sysmsg where msgval>0 and isview=0 and userid=" + user.id; string msgval = DBHlper.getfirstcolmn(cmd); if (msgval == "") { msgval = "0"; } context.Response.Write(msgval); } public bool IsReusable { get { return false; } } }