ASP Code

Create 'add to calendar' functionality with ASP

When running events and event registrations on a website, it's very beneficial for users to be able to add the even details to their calendars without having to manually enter them. To do this, you need to generate a .vcs file or output to send to the user. You can either generate this and return it in .vcs encoding, but in this code example I'll...
ASP Code, ASP.Net Code, PHP Code, Web

How to redirect a webpage in PHP, ASP, .Net, IIS, and .htaccess

If you've moved a domain or page, you need to redirect visitors. To transfer search engine links and ranking, you should use a 301 (HTTP code) redirect. The code "301" is interpreted by browsers and search engines as "moved permanently". Here's how to implement URL Redirection with several web technologies: PHP ASP ASP .NET IIS In Internet Services Manager, right click on the file or...
ASP Code

Block visitors based on IP address with ASP

I previously posted this code in PHP, and I thought it would be handy to have the ASP alternative, in case you need to block visitors or known spammers based on their IP address.
ASP Code

Track and display visitor count in globa.asa with ASP

It is very easy within ASP to track and display the total number of visitors to your web application. Using the global.asa file, which is automatically included and processed in each webapp, we can create some simple session variables to track visitors. To display the current total of users on the site, include the following code any where on your ASP pages.
ASP Code

Display directory contents with ASP

Here's a really quick way to list the files & folders in a directory with ASP. This code uses the FileSystemObject to list the files. Obviously, you need to replace "directoryname" with your directory name. Or better yet, if you know the physical path you can replace the virtual reference via Server.MapPath("/directoryname") with the actual path like this: "C:\Inetpub\wwwroot\homesite\directoryname" Just make sure the directory has...