Application_EndRequest

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
 
P

Paul Glavich

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?
 
R

Ryan

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
 
P

Paul Glavich

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top