I'm just trying to create a simple hit counter. I have a page with a label (lblNumHits) and a button (btnRefresh) that posts back to this same page via the buttons PostBackURL property.
I'm trying to create a cookie, set an initial value for the hit counter, when the btnRefresh is clicked and the page posts back, then increment the counter, update the counter value in the cookie, and update the label.
It works the first time the page loads and click the Refresh button (count = 1), then the cookie value is reset to 0 everytime the page posts back. Here's my code:
Partial Class HitCounter
Inherits System.Web.UI.Page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) H ...
Go to the complete details ...