Problem with hit counter increment.
-
I have label on homepage showing number of hits. I have used Session to keep track of it using database. When new session starts, its increment and on home page its getting reset. The problem is it works fine when I open site in new window, but when opened in multiple tabs of IE7, it shows same users and not incrementing. Here is the code. //Assigned 1 from global.asax on starting of each new session. lock (this) { HomeDataInterface oHits = new HomeDataInterface(); if (Session["Hits"].ToString() == "1") { oHits.QACoEHits(); Session["Hits"] = "0"; } lblHits.Text = lblHits.Text + oHits.GetQACoEHits(); } I added lock(this) but that is also not working. Can anyone help please?
-
I have label on homepage showing number of hits. I have used Session to keep track of it using database. When new session starts, its increment and on home page its getting reset. The problem is it works fine when I open site in new window, but when opened in multiple tabs of IE7, it shows same users and not incrementing. Here is the code. //Assigned 1 from global.asax on starting of each new session. lock (this) { HomeDataInterface oHits = new HomeDataInterface(); if (Session["Hits"].ToString() == "1") { oHits.QACoEHits(); Session["Hits"] = "0"; } lblHits.Text = lblHits.Text + oHits.GetQACoEHits(); } I added lock(this) but that is also not working. Can anyone help please?
cheers, Abhijit