문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top