Home arrow ASP.NET arrow Page 2 - Building a Counter Using JScript.Net
ASP.NET

Building a Counter Using JScript.Net


.Net includes several libraries that let us create images on the fly. In this article Michael shows us how to create a dynamic image-based counter with JScript.Net.

Author Info:
By:
Rating: 5 stars5 stars5 stars5 stars5 stars / 10
July 12, 2002
TABLE OF CONTENTS:
  1. · Building a Counter Using JScript.Net
  2. · How Should the Counter Work?
  3. · The JScript.Net Code
  4. · Conclusion

print this article
SEARCH DEVARTICLES

Building a Counter Using JScript.Net - How Should the Counter Work?
(Page 2 of 4 )

A counter should count the number of users visiting a web page. If a user opens a specific page, the counter should increase, create a new image, and save the number of visitors in a file. The number should only increase if the visitor is new. If you increment the number of visitors every time the counter is displayed, then obviously you do not get the correct numbers of unique visitors, and will then get the number of page views instead.

So, we only need to increment the counter if we’re dealing with a new visitor. We can do this with a cookie, using standard browser functions. With a cookie, we can send the browser a flag that the current user has already visited our web page. If the user comes back within 120 seconds then we will ignore this cookie and increment the counter.

Let's start with our JScript.Net code...
blog comments powered by Disqus
ASP.NET ARTICLES

- How Caching Means More Ca-ching, Part 2
- How Caching Means More Ca-ching, Part 1
- Reading a Delimited File Using ASP.Net and V...
- What is .Net and Where is ASP.NET?
- An Object Driven Interface with .Net
- Create Your Own Guestbook In ASP.NET
- HTTP File Download Without User Interaction ...
- Dynamically Using Methods in ASP.NET
- Changing the Page Size Interactively in a Da...
- XML Serialization in ASP.NET
- Using Objects in ASP.NET: Part 1/2
- IE Web Controls in VB.NET
- Class Frameworks in VB .NET
- Cryptographic Objects in C#: Part 1
- Sample Chapter: Pure ASP.Net

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials