Using GLOBAL.ASAX with Classic ASP?

V

Victor

Can I get the events in GLOBAL.ASAX to fire if a classic ASP page is being accessed by
the user?
 
P

Patrice

What is the goal ?

A way to do so would be to reference an ASPX page from your ASP page (for
example client side using an IFRAME or à la AJAX etc...)...
 
V

Victor

Patrice, thanks for responding.

One reason is I'm counting sessions as they start and end with Session_OnStart and
Session_OnEnd. I want to be able to not include spiders, and using
Request.Browser.Crawler is a nice, low-maintenance way of doing that.

Also, I understand that Session_OnEnd is much more reliable in GLOBAL.ASAX rather than
GLOBAL.ASA.

The website is presently over 500 pages of information. Some are old pages from the
website's earlier incarnations, including early static pages, and not part of the
present main application, so including IFRAMEs would not be practical at all.

So, my original inquiry stands.

Victor
 
J

Juan T. Llibre

No, but you can get global.asa events to fire with classic ASP.
You can fire all the events you need for classic ASP in it.
 
P

Patrice

My personal preference wouldn't be to use GLOBAL.ASAX to workaround possible
issues with GLOBAL.ASA (IMO this will complicate the all thing plus I'm not
sure that session end is much more reliable, for example if you later switch
to the SQL provider for sessions it won't work at all).

I would prefer much more to workaround the ASP issue I have with ASP alone.
For example you could :
- read the appropriate performance counter (possibly using a .NET assembly)
- keep track of session yourself without using the global.asa OnEnd event
(just register the last request date/time count for all sessions and count
those for which you had requests within the last "timeout" minutes, it could
be also a way to track if Session_end causes problem that is doing both and
comparing if you get the same value)

Also you could try a classic ASP newsgroup to see how others have workaround
this issue instead of adding ASP.NET to your equation...
 
V

Victor

No, but you can get global.asa events to fire with classic ASP.
You can fire all the events you need for classic ASP in it.

Um, global.asa is SUPPOSED to work with Classic ASP. That's what it is for!!!
 
V

Victor

My personal preference wouldn't be to use GLOBAL.ASAX to workaround possible
issues with GLOBAL.ASA (IMO this will complicate the all thing plus I'm not
sure that session end is much more reliable, for example if you later switch
to the SQL provider for sessions it won't work at all).

GLOBAL.ASAX is significantly more reliable than GLOBAL.ASA when it comes to
Session_OnEnd. We ran some simple tests to prove it - try it yourself.

Your statement on the SQL provider is not applicable to our sitiation.
I would prefer much more to workaround the ASP issue I have with ASP alone.
For example you could :
- read the appropriate performance counter (possibly using a .NET assembly)
- keep track of session yourself without using the global.asa OnEnd event
(just register the last request date/time count for all sessions and count
those for which you had requests within the last "timeout" minutes, it could
be also a way to track if Session_end causes problem that is doing both and
comparing if you get the same value)

First of all, this is a hell of a lot of work to do when compared to using GLOBAL.ASAX,
which is a much more elegant, simple, and EFFICIENT solution. Right now, the site loads
lightening fast because we keep the code tight and optimized. Your solution generates
overhead that can be easily eliminated by using a GLOBAL.ASAX solution.

Second, your suggestion simply doesn't work. Remember, I have over 500 pages, including
some old legacy pages. Tracking all sessions would not be practical at all.

I appreciate your help, but if you don't know how to do what I want I'd rather you admit
that instead of trying to talk me out of doing it. I've been told that what I want to do
can be accomplished by a setting in IIS.

Victor
 
J

Juan T. Llibre

re:
I've been told that what I want to do can be accomplished by a setting in IIS.

You could map global.asax to asp.dll, but that wouldn't make
those events available to you as they, simply, don't exist in ASP.




Victor said:
...

GLOBAL.ASAX is significantly more reliable than GLOBAL.ASA when it comes to
Session_OnEnd. We ran some simple tests to prove it - try it yourself.

Your statement on the SQL provider is not applicable to our sitiation.
First of all, this is a hell of a lot of work to do when compared to using GLOBAL.ASAX,
which is a much more elegant, simple, and EFFICIENT solution. Right now, the site loads
lightening fast because we keep the code tight and optimized. Your solution generates
overhead that can be easily eliminated by using a GLOBAL.ASAX solution.
Second, your suggestion simply doesn't work. Remember, I have over 500 pages, including
some old legacy pages. Tracking all sessions would not be practical at all.
 

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,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top