Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 15th, 2006, 01:02 AM
Authorized User
Join Date: May 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Application Hit Count


How to get Application Hit Count in Asp.net for each user.


Old July 15th, 2006, 06:05 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

You can do it 2 ways, use an application variable or store the hit in a database but there is are downfalls to each.

First if you use an application variable to maintain the number of hits, that variable will only hold true until you have to restart the webserver or the webserver goes down, once it comes back up your applicatin variable that is storing the hits will revert back to 0.

You can store the hit in the database but then you have a round trip to your database to insert the hit into a table.

You would facilitate either way by doing something like this in the global.asax file:

Sub Application_Start
 Application("counter") = 0
End Sub

Sub Session_Start
   [Set Application variable or make a call to your database here]
End Sub

"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hit-count for dynamic page Steve777 ASP.NET 2.0 Basics 2 June 24th, 2008 11:09 AM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
retrieve everything AND count rows in one hit crmpicco MySQL 5 January 20th, 2006 06:02 AM
Count, sum, count a value, return records CongoGrey Access 1 April 18th, 2005 02:25 PM
Hit Count rajuru PHP Databases 1 November 1st, 2004 10:47 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.