I'm creating a custom HttpModule for DNN 6/7 to do a little user tracking on our sites. I've setup the HttpModule to log the Referral Url and the Current Page Url. I'd also like to have the HttpModule website platform inspecific so it works with a DNN site and non-DNN sites.
t.Referrer = request.UrlReferrer != null ? request.UrlReferrer.ToString() : "(direct / unknown)";
t.Page = request.Url.ToString();
The referral URL presents as I intend (http:// site / folder / page.aspx), but the current page is presenting as the DNN tab (http:// site / folder / default.aspx?TabID=123).
Is there a way in my custom module to access the "DotNetNuke.Entities.Tabs.TabController.CurrentPage.FullUrl" ?
I guess, furthermore, also how to elegantly access FullUrl if it's available (when/if the HttpModule is used with a DNN site and/or page) and simply accessing the URL normally (when/if the HttpModule is NOT used with DNN)?
I think obviously that would just be an If/Null/Else, but is there a more elegant way to handle that in this situation?
C# example would be best, but I understand the VB syntax as well.
Thanks!