I've been doing a lot of searching and I can't nail down exactly to how to accomplish this...
What I want to do is create a simple (unique) visitor counter on my DNN 6.1.5 site. I have a lot of experience with ASP programming and a little bit with ASP.NET. I prefer to avoid bulky third party hit counting modules. Also, I have never seen one of those that will work for me--I want to grab the raw number of hits and I need to place it in a footer. Some hit count modules do provide tokens, such as [TEXTHITCOUNT] or whatnot, but I cannot use the replace tokens option because I don't need/want the hit count displayed inside of a container--I need to display it in a stand-alone .aspx file.
Anyway, with a normal ASP.NET application, I could simply add code in global.aspx so that on Application_start, I create and initialize a hitcount variable. Then I would increment that variable on Session_start. I could then access that variable from anywhere I needed to. I could then write the current count to a database or text file when the application is going to shut down, so that my hit count is persistent through server restarts, etc.
Through my research, it seems I cannot do this in DNN 6. I see the global.aspx file but it contains only one line of code:
<%@ Application Codebehind="Global.asax.cs" Inherits="DotNetNuke.Common.DotNetNukeHttpApplication" Language="C#" %>
So there is no code behind file specified. I understand from research that DNN actually consumes the event information via the DotNetNukeHttpApplication module:
Finally, I have many articles that describe creating custom Http modules for DNN and I finally gave up because I always hit issues that I cannot work past. So I instead turned to trying to create my own skin object/control to do the same thing. But again, I have failed to find a concrete example of accessing the equivalent events/information of Application_Start and Session_Start from within a skin object/control.
Can anyone provide me with a concrete code example of accessing/using the Application_Start and Session_Start events from within the DNN framework, preferably via a skin control/object?
(Sorry for the long description but I assure you this is not one of those lazy posts trying to get someone to do the work for me. I have spent over a week writing code, researching, and exploring numerous avenues and have been left frustrated and broken...)