Posted by: Imar Spaanjaars at Monday, November 24, 2003 10:22:04 AM in:
ASP.NET 1.x
If you have a live Web site on the World Wide Web, you may be interested
in how many people are visiting your site. You can of course analyze the
log files of your Web server but that information is usually difficult
to read. The log files contain information for each and every request a
visitor has made to your site, including resources like images, Flash movies
and so on. This makes it near impossible to extract information about individual
users. It would be a lot easier if you could count the number of individual
users that have visited you since you started your site. It would also
be useful if you could see the number of users that are currently browsing
your site.
This article will show you how to accomplish these two tasks by storing
the hit counters in static variables using code in the
Global.asax file.
The disadvantage of this method is that this information is lost when you
restart the Web server. Two other articles on this site demonstrate how
to store this information in a
text
file and
in a
database, so the value for
the counter will be preserved when you restart your Web server.
There is also a
Classic ASP version of
this article available
Read on ...
Posted by: Imar Spaanjaars at Friday, November 21, 2003 9:52:40 PM in:
Imar's Blogs
Today I finally had the time again to work on the site.
Read on ...
Posted by: Imar Spaanjaars at Saturday, November 08, 2003 8:52:05 PM in:
Classic ASP
Use this snippet to check whether a given number (passed in as numberToCheck is even or odd.
Read on ...
Posted by: Imar Spaanjaars at Saturday, November 08, 2003 8:33:39 PM in:
T-SQL
This T-SQL snippet allows you to select duplicate records from a database table. The example assumes that the column Id is used to determine whether a record has a duplicate. If multiple columns determine whether a record has a duplicate or not, simply expand the SELECT list and the GROUP BY clause.
Read on ...
Read on ...
Posted by: Imar Spaanjaars at Sunday, November 02, 2003 5:30:19 PM in:
Classic ASP
Add the following code to the top of your ASP page to prevent it from being cached by the browser or any intermediate proxy or caching server. This will force the browser to retrieve a new copy of the page, everytime it needs to display it.
Read on ...
Posted by: Imar Spaanjaars at Saturday, November 01, 2003 10:58:44 AM in:
Dreamweaver
If you have a copy of the book
Beginning
Dreamweaver MX, I am sure you are familiar with the project
TheSoccerSite.
For those not familiar with the project, TheSoccerSite is a Web site where soccer
fans around the world go for up-to-date information about soccer events. In 7
Chapters, Server- and Client-Side programming, using ASP,
HTML, JavaScript and a Microsoft Access database were introduced. One of
the features of the site was a login mechanism to protect the admin section from
unauthenticated and unauthorized users.
However, with the current implementation of the login mechanism, you would have
to add new users to the database directly. To do this, you'd need to download
the database, add the user and then upload the database again. Fortunately, Dreamweaver
has a few handy Server Behaviors that make adding a new user to the database very easy.
Read on ...
Posted by: Imar Spaanjaars at Thursday, October 30, 2003 9:49:05 AM in:
Imar's Blogs
Pffff, my part of the book Beginning Dreamweaver MX 2004 is done. Last weekend I sent in the latest versions of my Chapters, so as far as my contribution is concerned, the book is done.
Read on ...
Posted by: Imar Spaanjaars at Wednesday, October 22, 2003 6:04:28 PM in:
Imar's Blogs
Yesterday I published a new article that answers a very frequently asked question: "How can I force the browser to present the Save As dialog, instead of having the file opened by the browser?" I published it in the ASP category of the Articles section, because it was a bit too long for a FAQ. You can find the article
here.
Read on ...
Posted by: Imar Spaanjaars at Tuesday, October 21, 2003 9:20:50 PM in:
Web General
Your Web browser is set up to handle all kinds of documents. For example,
when you open an .html page from a Web site,
the browser knows it should parse this file, and display its rendered contents
onscreen. The same is true for images; when you click on a link that directly
links to an image, the image will be displayed in the browser.
This default behavior may not always be what you want. In some scenario's,
it's useful to have the user download and save the file, instead of displaying
it in the browser. This is a common requirement for files like images,
Word documents, spread sheets and so on. This article will demonstrate
you how you can force the client browser to present the Save As dialog, so
your users can download the file and save it on their local hard disk.
Read on ...