I have a page which I cache for hours using outputcaching. However, I still want to log each pageview in my database.
It is quite important I get access to my codebehind, as I will use these data to show personalized data.
So my outputcache parameter is:
<%@ OutputCache duration="7200" VaryByParam="*" %>
Solution thoughts...
I guess I basically want donut caching, but I really can't find too much info about it.
Will the substitution control be suitable for this? Would a user control be cached?
What's the best solution to access database to store a pageview, even though we're using outputcaching?
You can basically create a custom HttpHandler
in asp.net and call that handler with appropriate parameters using javascript on page load. That handler will do rest of the things like saving page access related data in database etc.
Let me know if you need more help.