473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Application_EndRequest

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
Nov 18 '05 #1
3 5508
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 Glavich
"Ryan" <no****@nospam.net> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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

"Paul Glavich" <gl**@aspalliance.com-NOSPAM> wrote in message
news:eW****************@TK2MSFTNGP12.phx.gbl...
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 Glavich
"Ryan" <no****@nospam.net> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3
Ryan, see me reply to your other post re: NonPersistentPageCache

--
- Paul Glavich
"Ryan" <no****@nospam.net> wrote in message
news:eW*************@tk2msftngp13.phx.gbl...
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

"Paul Glavich" <gl**@aspalliance.com-NOSPAM> wrote in message
news:eW****************@TK2MSFTNGP12.phx.gbl...
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 Glavich
"Ryan" <no****@nospam.net> wrote in message
news:et**************@TK2MSFTNGP12.phx.gbl...
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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Edward Jones | last post by:
I want to send users to an Access Denied page rather than the Login page when they are authenticated but not authorized to see a specific page while using Forms based authentication in ASP.Net. ...
0
by: Sherif ElMetainy | last post by:
Hello I want to handle the System.Web.HttpApplication.EndRequest event i use the following code System.Web.HttpContext.Current.ApplicationInstance.EndRequest += new...
3
by: Kaya | last post by:
in the Global.asax Application_EndRequest prodecure the application do something and it works normally but when i try to use session it gives errors "Object reference not set to an instance of an...
1
by: Ryan | last post by:
The real reason for my previous post about intercepting Application_EndRequest (from outside of Global.asax) is because of a need to create a "non persistent page level cache". I can't seem to...
0
by: Chris | last post by:
Hi, I entered some logging-stuff in global.asax : namely in Application_Start(), Application_End(), Session_Start() , etc .... When I start the ASP.NET app from within Visual Studio does it...
1
by: Wayne Sepega | last post by:
In our web application we have a routine that will take a URL and encrypt the query string portion of it. We are doing this in the Global.asax in Application_EndRequest, we have done this in 1.1...
1
by: sai | last post by:
hi all, i have writen the following code in global.asax events and i have kept break points on following events to trace. protected void Session_Start(Object sender, EventArgs e) { ...
0
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before...
0
by: =?Utf-8?B?U00=?= | last post by:
Hi, We had the following code in our global.asax.cs file when our code was in ..net 1.1 Please note that our production environment uses SSL ad windows authentication based single sign on. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.