Deciding whether you need dynamic content is something only you can do, and depends on the nature of the pages you want to create. But, having accepted that it is a good way to both minimize administrative effort and create attractive pages, you need to be aware of the different ways it can be achieved. In this first section of the chapter, we'll overview and summarize the main techniques. This will help you to understand what options are available, how they differ, and which is the best choice for your particular situation.
Dynamic content techniques can be divided up in several ways. For example, some are used client-side in the browser, and others server-side. Some use a database to provide the source information, and others use text files, components, or just scripting. The following table shows the common techniques, together with an example of the technology they use. The table also indicates where most of the programming to achieve the dynamism occurs.
Technique | Technology | Server? | Client? |
Writing content directly with script | JavaScript, VBScript, etc. | Yes | Yes |
Including the contents of a disk file | Server-side Includes (SSI) | Yes | No |
Using a text 'content list' file | Content Linking Component | Yes | No |
From a delimited text file | Remote Data Service (RDS) | No | Yes |
From a database on the server | ActiveX Data Objects (ADO) | Yes | No |
From a database on the server | Remote Data Service (RDS) | No | Yes |
From a SQL Server database | SQL Web Assistant | Yes | No |
From a non-relational data store | ActiveX Data Objects (ADO) | Yes | No |
Of course, the techniques shown above are often combined to create more interactive or responsive solutions. For example, as we briefly noted when we looked at reasons for using frames in the previous chapter, it's quite possible to store values on the client within a frameset, and use them as you create pages dynamically within the frameset. The values you use could originally have come from a database, and been inserted into the frameset page using ASP script on the server.
It's this combination of the different techniques that makes building dynamic sites such a fascinating and challenging task. We used this approach to build an application for a fictitious motor car sales company in one of our sister books (Professional MTS MSMQ with VB and ASP, ISBN 1-861001-46-0):
You'll see similar techniques to the ones used in this example later in this chapter, and throughout the remainder of the book. You can run the Wrox Car Company example from our Web site's Windows DNA page at http://webdev.wrox.co.uk/dna/. When you've finished playing with it, and once you've ordered your new sports car, we'll move on to look at each of the techniques we listed earlier.