Enhancing Design-Time Support in your Controls

Posted by: Imar Spaanjaars at Thursday, June 24, 2004 4:17:41 PM in: .NET General

Server controls allow a page developer to drag and drop a page together in no to time. Most of these controls come "out of the box" with ASP.NET like the TextBox, the Label, the DataGrid and many other controls. Changing the appearance and behavior of these controls is often as easy as visually setting a few properties in the properties grid for your design application, like Visual Studio .NET or the Web Matrix.. To make this process even easier, many properties can be expanded and collapsed in the property grid. By collapsing a property like the Font style, you end up with a shorter and much cleaner property list, making it easier to locate and change your properties.

Adding these collapsible properties to your own server controls is possible as well. This article will guide you through the process of creating a simple server control that exposes a collapsible property in the property grid of visual designers like Visual Studio.NET or the Web Matrix.

Read on ...

How Do I Insert 'Now Playing' Info to my Posts on P2P?

Posted by: Imar Spaanjaars at Monday, April 26, 2004 7:34:08 AM in: .NET General

Over the past few weeks, I received numerous e-mails from P2P contributors asking me how I was able to insert information in my signature at the Wrox P2P forum about the music I am listening to when I make the post. Some wondered if I had nothing to do at all, and had all the time in the world to insert this information manually. Others already had the idea I had automated this process and were interested in the technical solution of this, rather useless, feature.

In this article I'll explain where I got the idea for this automated signature, what techniques and concepts were involved, and where I found the information required to build the solution.

Read on ...

Logging Errors to the Event Log in ASP.NET Applications

Posted by: Imar Spaanjaars at Thursday, April 15, 2004 11:33:55 PM in: ASP.NET 1.x

Let's face it. We're not living in a perfect world. I am not a perfect programmer, and the same probably applies to you (otherwise you would be stinkin' rich, laying on the beach somewhere drinking a Bacardi and Coke, instead of reading this article).

Because we aren't perfect, we know we are going to run into errors in the applications we write sooner or later. This article will explain how you can catch these errors in your ASP.NET applications and log them to the Windows Event log, so it's easy to review them later. The article focuses on ASP.NET, but the principle applies to other .NET applications as well.

Read on ...

Howto Create a Hit Counter Using a Database in ASP.NET 1.x with VB.NET

Posted by: Imar Spaanjaars at Tuesday, March 02, 2004 6:32:40 PM 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 shared variables in the Global class and in a database using code in the Global.asax file. The counters in the shared variables are used to display them on a page in your Web site; either as a counter so your visitors can see it as well, or somewhere on a page in your Admin section, so only you have access to them. By writing the counters to a database you can maintain their value even when you restart the Web server, while you still have a fast and scalable solution.

This article extends the ideas from two previous articles where the values of the counters were just stored in static variables in the Global class and in a text file.

There are also Classic ASP and ASP.NET C# versions of this article available.
Read on ...

Howto send E-mail from an ASP page

Posted by: Imar Spaanjaars at Wednesday, February 18, 2004 8:50:30 PM in: Web General
This article will show you how simple it can be to send an e-mail from an ASP page. With just a few lines of code, you can add mail sending capabilities to your ASP page in your Web site. Notice that I put the focus on can be; depending on your network setup, this approach may be very easy, or it may require you to setup or configure your network for this code to work. See the reference section at the end of this document for more information.
Read on ...

Searching TheSoccerSite With Dreamweaver MX

Posted by: Imar Spaanjaars at Thursday, February 05, 2004 3:39:25 PM in: Web General

More and more Web sites these days are database-driven. That means that most of the content, customer data, site statistics and maybe even information used for the navigation menu or other layout purposes is stored in a database.

With all that data stored in a database, you also need to provide a means to let your users search for it in the database. Since this information is not file based, you can no longer use tools like Index Server that index the contents of physical files. Instead, you'll need to code the query logic yourself. For each database-driven application, the search facility will be different, because usually your back-end database and the front-end requirements are different. However, part of code can easily be reused in other projects. In this article, I will focus on building a search facility for TheSoccerSite, a database-driven soccer fan site that was created in section 2 of the books Beginning Dreamweaver MX and Beginning Dreamweaver MX 2004. Although the implementation will be specific for the Soccer Site project, you'll get enough background to successfully implement a search facility on your own Web site.

Read on ...

Howto Create a Hit Counter Using a Database in ASP.NET 1.x with C#

Posted by: Imar Spaanjaars at Sunday, January 18, 2004 2:53:40 PM 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 shared variables in the Global class and in a database using code in the Global.asax file. The counters in the shared variables are used to display them on a page in your Web site; either as a counter so your visitors can see it as well, or somewhere on a page in your Admin section, so only you have access to them. By writing the counters to a database you can maintain their value even when you restart the Web server, while you still have a fast and scalable solution.

This article extends the ideas from two previous articles where the values of the counters were just stored in static variables in the Global class and in a text file.

There are also Classic ASP and VB.NET versions of this article available.
Read on ...

Howto Create a Hit Counter Using a Text File in ASP.NET 1.x

Posted by: Imar Spaanjaars at Friday, November 28, 2003 11:55:33 PM 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 in the Global class and in a text file using code in the Global.asax file. This article extends the ideas from a previous article where the values of the counters were just stored in static variables. By writing the counters to a file you can maintain their values, even when you restart the Web server.

There is also a Classic ASP version of this article available.
Read on ...

Howto Create a Hit Counter Using the Global.asax File in ASP.NET 1.x

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 ...

Allowing Your Users to Sign Up for Your Site

Posted by: Imar Spaanjaars at Saturday, November 01, 2003 10:58:44 AM in: Web General
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 ... 1234567891011