Windows NT Explorer
This column is intended to bring users' attention to the value of employing Windows NT server technology within their institution. This issue covers Active Server Pages (ASP) - one of the most useful benefits of having a Windows NT based web server.
Most web developers will encounter ASP through its inclusion with Microsoft's Internet Information Server  - the most popular Windows NT web server software. Internet Information Server is free, although you have to purchase a licence for Windows NT Server. However, ASP is by no means confined to Microsoft web servers or operating systems; a product from Chili!Soft  called Chili!ASP allows ASP to be run in a variety of non-Microsoft environments.
What are Active Server Pages?
ASP pages are HTML documents that usually have a .asp file extension, and have server-side scripting nested around the HTML source. When an ASP document is requested from the server, the ASP scripting is interpreted, and the script output, together with the HTML contained within the document, are sent to the client's browser. This makes ASP similar to PHP3 , or, to some extent, the Server-Side Includes that are a feature of most web servers. ASP commands are usually inserted in the HTML markup between <%%> tags. So a basic ASP-enabled web page might look like this:
<TITLE>A simple ASP web page</TITLE>
<%Response.Write("<H1><FONT COLOR=red>Hello World!</FONT></H1>")%>
Figure 1: The simple ASP web page as displayed in a web browser
The advantage of using embedded scripting is that you can write the embedded ASP code in the HTML editing mode of your website creation application, then switch to a WYSIWYG page layout view in order to work on the appearance of the page. FrontPage 98 is one such application that allows easy switching between the WYSIWYG and HTML source view, and as long as you are aware of its idiosyncrasies, it won't mess up your ASP scripting. Alternatively, Visual InterDev  or EasyASP  are two specialised ASP editors that are worth considering.
Figure 2: Visual InterDev 6 is a specialised ASP editor
What can ASP be used for?
Out of the box, ASP contains six objects that can be referenced in web pages:
- The Application object contains several methods for controlling web based applications. Using these methods it is (for example) possible to ensure that certain scripts are executed on the server whenever a client requests a document in a specified part of your website.
- The ObjectContext object allows ASP to be integrated with Microsoft Transaction Server (useful in the creation of robust web based applications).
- The Request object is used to retrieve information that the client sends to the server during a HTTP request. This object makes it straightforward to retrieve HTTP headers, cookies, and information sent either through the query string, or from a web form.
- The Response object is used to send information back to the client. This includes text, images, cookies, HTTP headers and other information.
- The Server object can be used to create instances of other server components, which are of use in the creation of web applications. There are also invaluable methods for converting strings to URL encoded text (which should be used when passing information between web pages using query strings).
- Finally, the Session object allows state to be maintained between concurrent HTTP transactions from the same client machine. This saves having to keep passing certain variables between web pages by use of forms or querystrings. The Session object is particularly useful when creating complex web applications, or sites where users have to log in before gaining access to the content.
A common use of ASP is to link websites to other applications or services. This is usually achieved through the use of server components. Components can be rapidly created using a programming language such as Microsoft's Visual Basic. Alternatively, there are plenty of existing components that can be used. To get you started, Internet Information Server comes with a few - these can be used for database access, content rotation, finding client browser capabilities etc. Alternatively, a wide variety of 3rd party components are available , many of which have been released as freeware.
One area where ASP is particularly strong is in the area of database connectivity. The ability of Internet Information Server to link a website to any ODBC compliant database (and this includes Microsoft Access and SQL Server databases) through the use of a server component is arguably the most desirable feature of ASP. The feature is particularly welcome, given the strong rise in demand for database driven Intranet and Internet sites.
It is also possible to use server components to connect ASP to Exchange Server. The Outlook Web Access supplied with Microsoft Exchange Server uses ASP to create a completely web-based version of Outlook 98:
Figure 3: Outlook Web Access - a sophisticated web application that makes extensive use of ASP
There is an abundance of great resources for ASP developers, and the online ASP community is flourishing. The following websites are good starting places: 15 Seconds , activeserverpages.com , and the ASP Alliance . Wrox Press Inc.  publish some of the best printed books about ASP. Some of their recent offerings (, ) cover emerging technologies, such as combining ASP with the Active Directory Services Interfaces .
Summary and Conclusions
The web has always allowed the use of server-side scripts or executable files to provide the ability to extend the functionality of websites. Although some impressive applications can be created this way, development times can be long, and a great deal of technical expertise is required. By contrast, ASP has two major advantages over these development schemes; speed of development and ease of use. By basing ASP on VBScript, Microsoft has opened up the world of server-side web development to the millions of Visual Basic developers out there.
One major downside with ASP is that specialist ASP developers are hard to come by, and for many Unix/Linux experts, adjusting to Windows NT systems can be problematic. That said, ASP documentation is excellent, and in my opinion is far better than anything written about creating server-side scripts using Perl on Unix systems.
A few people are also sceptical about the abilities of ASP. But the fact that ASP is now used on plenty of high profile websites should give people confidence to use ASP within their institution. Examples of ASP users include Microsoft (www.microsoft.com), Tesco (www.tesco.co.uk), Compaq (www.compaq.com) and UEFA (www.uefa.com).
At Essex in particular, ASP technology is proving to be an essential tool to have in the web technology toolbox. Several of our users are starting to explore the potential of directly linking databases to the web, and ASP is proving to be invaluable in the provision of facilities to link databases to the web.
Current uses for ASP at Essex include*:
- The Essex web search facility  relies on ASP to provide the web front-end to the Site Server search catalogues.
- ASP provides a web interface to several Exchange Server Public Folders, allowing email mailing lists to be read through a web browser.
- ASP validates many web based forms, preventing the entry of spurious or inaccurate data.
- Lots of small ASP scripts have been created for doing routine tasks, like automatically adding the name of the document author to all the web pages within the Computing Service website.
* Many of these examples are on "Intranet" sites that have access restrictions - contact me if you are interested in viewing such examples.
Some future uses that have been discussed:
- Active Directory Services Interfaces and ASP could be used to replace the X.500 web phonebook with a more user friendly solution based on the Lightweight Directory Access Protocol (LDAP).
- The integration of ASP with Internet Information Server and hence the Windows NT security model could eventually allow students to view lecture timetables, book places on courses and check examination results through a web browser.
- Microsoft's Internet Information Server, website
- Chili!Soft, website
- PHP: Hypertext Preprocessor, website
- Microsoft Visual InterDev, website
- EasyASP, website
- ActivePerl is available from the ActiveState Tool Corp. website
- Component section of 15seconds, website
- 15seconds, website
- activeserverpages.com, website
- ASP Alliance, website
- Wrox Press Inc., website
- Hahn, Steven. ADSI ASP Programmer's Reference, Wrox Press Ltd.
- Freidlitz, Mikael & Mondor, Todd. ADSI CDO Programming with ASP, Wrox Press Ltd.
- Active Directory Service Interfaces Overview, technical resources from Microsoft's website
- Windows NT Explorer: The Microsoft Site Server Search Facility, Brett Burridge, Ariadne issue 19
University of Essex
Essex, CO4 3SQ
Brett Burridge is a Systems Programmer in the Computing Service at the University of Essex.