Session 在一般处理程序ashx中取值要引用接口 IRequiresSessionState
<%@ WebHandler Language="C#" Class="Handler" %> using System; using System.Web; using System.Data; using System.Text.RegularExpressions; using affordableasia.sabre; using System.Web.SessionState; public class Handler : IHttpHandler, IRequiresSessionState { public void ProcessRequest (HttpContext context) { if(context.Request["Key"] !=null) { string key= context.Request["Key"] Session["Key"] session=Session[key] context.Response.ContentType = "text/plain"; context.Response.Write(price); } } } }
需要引用接口 IRequiresSessionState 才能取到值
生活因为改变而美丽.让我每天改变一点点.努力多一点点.成功就多两大点.这就是1+1>2