Application_EndRequest

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

I'm having trouble hooking the EndRequest event of the application, my code
looks like this:


class NeedsToTrapEndRequest {
static Hashtable _hash;

static public void CreateHash() {
_hash = new Hashtable();
HttpContext.Current.ApplicationInstance.EndRequest += new
EventHandler(OnEndRequest);
}

static OnEndRequest(object sender, EventArgs e) {
}
}

The problem is that OnEndRequest never gets called. What am I missing here?

Thanks, Ryan
 
In what module is the code below? ie. Is it also in the Global.asax code
behind and where do you call it from to associate the event to your delegate
method?
 
Paul, please see my other post as well "Non persistent page cache". It
contains the entire class (as the class name NonPersistentPageCache).

I use the class like so:


class MyPage : System.Web.UI.Page
{
Page_Load(..)
{
NonPersistentPageCache.Cache["asdf"] = "hi";
}

txtEmployeeNumber_OnPreRender(...)
{
string s = NonPersistentPageCache.Cache["asdf"];
}
}



-Ryan
 
Ryan, see me reply to your other post re: NonPersistentPageCache

--
- Paul Glavich


Ryan said:
Paul, please see my other post as well "Non persistent page cache". It
contains the entire class (as the class name NonPersistentPageCache).

I use the class like so:


class MyPage : System.Web.UI.Page
{
Page_Load(..)
{
NonPersistentPageCache.Cache["asdf"] = "hi";
}

txtEmployeeNumber_OnPreRender(...)
{
string s = NonPersistentPageCache.Cache["asdf"];
}
}



-Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top