Finally, you might want to get some idea of how frequently your page is being accessed without having to dig through the server logs. The Page Counter component enables you to do that with just a few lines of code. We can add this under the banner ad on index.asp with the code in Listing 3.31.
On line 41, we create the Page Counter object, pageCount, then on line 42 we use the <%= %> syntax to print out the count. The PageHit method actually increments the counter, adding 1 every time the page is hit. To retrieve the count without incrementing, we could have used pageCount.hits instead of pageCount.pageHit. You can also reset the value number of hits for this page using the Reset method, so the command would be pageCount.Reset.
3.129.208.25