public void Back(String k, Object v, CacheItemRemovedReason r)
      {
         try
         {
           Cache cache =new Cache();
          cache.Insert("linli1","123",null,System.DateTime.Now.AddMinutes(0.1),Cache.NoSlidingExpiration,System.Web.Caching.CacheItemPriority.Default,new System.Web.Caching.CacheItemRemovedCallback(Back));
     
         }
         catch
         {
            
         }      }

protected void Application_Start(Object sender, EventArgs e)
{
 Context.Cache.Insert("linli","123",null,System.DateTime.Now.AddMinutes(0.1),Cache.NoSlidingExpiration,System.Web.Caching.CacheItemPriority.Default,new System.Web.Caching.CacheItemRemovedCallback(Back));
}
在回调时的Back 函数异常,为什么,怎么解决?

解决方案 »

  1.   

    Catch到的提示的异常信息是什么?
      

  2.   

    {"Object reference not set to an instance of an object." 
    帮忙的好兄弟可以复制到Global文件中
      

  3.   

    public void Back(String k, Object v, CacheItemRemovedReason r)
          {
             try
             {
    //           Cache cache =new Cache();
              httpContext.cache.Insert("linli1","123",null,System.DateTime.Now.AddMinutes(0.1),Cache.NoSlidingExpiration,System.Web.Caching.CacheItemPriority.Default,new System.Web.Caching.CacheItemRemovedCallback(Back));
         
             }
             catch
             {
                
             }      }