Skip to Content

Windows NT Explorer

Printer-friendly versionPrinter-friendly versionSend to friendSend to friend

Brett Burridge discusses Active Server Pages (ASP) - one of the most useful facilities provided by Windows NT server.

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 [1] - 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 [2] 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 [3], 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:

<HTML>
<HEAD>
<TITLE>A simple ASP web page</TITLE>
</HEAD>
<BODY>
<%Response.Write("<H1><FONT COLOR=red>Hello World!</FONT></H1>")%>
</BODY>
<
/HTML>

In a web browser, this basic web page will be displayed as shown in Figure 1. Since all ASP code is executed on the server, it can also be used as an alternative to client-side JavaScript for those everyday functions such as validating the input from forms. This is useful because the ASP scripts will be completely browser independent.

output from the basic ASP web page shown above
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 [4] or EasyASP [5] are two specialised ASP editors that are worth considering.

Visual InterDev supports editing of ASP documents in both HTML and page layout view
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.

As well as these objects, ASP is a complete scripting language in its own right. The default scripting language is Visual Basic Scripting Edition (VBScript); a subset of Microsoft's Visual Basic. VBScript is the most popular language for writing ASP, and the vast majority of sample websites and printed books use this scripting language. Internet Information Server is also supplied with the facility for writing ASP scripts in JScript (a relative of the popular JavaScript scripting language). If you install ActivePerl [6] on your server, you will also be able to use PerlScript, a version of the popular Perl scripting language. PerlScript extends the functionality of ASP considerably - most existing Perl scripts can be ported to PerlScript, and it is also useful to be able to use the large number of Perl modules available.

Web applications

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 [7], 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:

Screenshot of Outlook Web Access running in a web browser
Figure 3: Outlook Web Access - a sophisticated web application that makes extensive use of ASP

Resources

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 [8], activeserverpages.com [9], and the ASP Alliance [10]. Wrox Press Inc. [11] publish some of the best printed books about ASP. Some of their recent offerings ([12], [13]) cover emerging technologies, such as combining ASP with the Active Directory Services Interfaces [14].

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 [15] 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.

References

  1. Microsoft's Internet Information Server, website
    <URL: http://www.eu.microsoft.com/ntserver/web/>
  2. Chili!Soft, website
    <URL: http://www.chillisoft.com/>
  3. PHP: Hypertext Preprocessor, website
    <URL: http://uk.php.net/>
  4. Microsoft Visual InterDev, website
    <URL: http://msdn.microsoft.com/vinterdev/>
  5. EasyASP, website
    <URL: http://www.optweb.net/ebanker/easyasp/>
  6. ActivePerl is available from the ActiveState Tool Corp. website
    <URL: http://www.activestate.com/>
  7. Component section of 15seconds, website
    <URL: http://www.15seconds.com/component/default.htm>
  8. 15seconds, website
    <URL: http://www.15seconds.com/>
  9. activeserverpages.com, website
    <URL: http://www.activeserverpages.com/>
  10. ASP Alliance, website
    <URL: http://www.aspalliance.com/>
  11. Wrox Press Inc., website
    <URL: http://www.wrox.com/>
  12. Hahn, Steven. ADSI ASP Programmer's Reference, Wrox Press Ltd.
    <URL: http://www.wrox.com/Store/Details.asp?Code=169X>
  13. Freidlitz, Mikael & Mondor, Todd. ADSI CDO Programming with ASP, Wrox Press Ltd.
    <URL: http://www.wrox.com/Store/Details.asp?Code=1908>
  14. Active Directory Service Interfaces Overview, technical resources from Microsoft's website
    <URL: http://www.eu.microsoft.com/windows/server/Technical/directory/adsilinks.asp>
  15. Windows NT Explorer: The Microsoft Site Server Search Facility, Brett Burridge, Ariadne issue 19
    <URL: http://www.ariadne.ac.uk/issue19/nt/>

Author Details

Brett Burridge
University of Essex
Computing Service
Wivenhoe Park
Colchester
Essex, CO4 3SQ
Email: brettb@essex.ac.uk

Picture of Brett BurridgeBrett Burridge is a Systems Programmer in the Computing Service at the University of Essex.

 

Date published: 
22 June 1999

This article has been published under copyright; please see our access terms and copyright guidance regarding use of content from this article. See also our explanations of how to cite Ariadne articles for examples of bibliographic format.

How to cite this article

Brett Burridge. "Windows NT Explorer". June 1999, Ariadne Issue 20 http://www.ariadne.ac.uk/issue20/nt/


article | by Dr. Radut