问题描述:
在.ashx中,可以写出Session[ ],但是在使用的时候报告:对象的引用未设置到对象的实例。Object reference not set to an instance of an object.
解决方案:
1、引入命名空间:using System.Web.SessionState;
2、实现接口:IRequiresSessionState
完整如下:
using System.Web.SessionState;
namespace ma
{
/// <summary>
/// Summary description for upload
/// </summary>
public class upload : IHttpHandler,IRequiresSessionState
{
}
}