Active Server Pages
From Wikipedia, the free encyclopedia
Active Server Pages (ASP) is Microsoft's first server-side script engine for dynamically-generated web pages. It was initially marketed as an add-on to Internet Information Services (IIS) via the Windows NT 4.0 Option Pack, but has been included as a free component of Windows Server since the initial release of Windows 2000 Server. Programming ASP websites is made easier by various built-in objects. Each object corresponds to a group of frequently-used functions useful for creating dynamic web pages. In ASP 2.0 there are six such built-in objects: Application, ASPError, Request, Response, Server, and Session. Session, for example, is a cookie-based session object that maintains variables from page to page. Web pages with the ".asp" or file extension use ASP, although some Web sites disguise their choice of scripting language for security purposes. The ".aspx" extension is not an ASP page, but an ASP.NET page, another server-side scripting language from Microsoft, based on a mixture of traditional ASP, and Microsoft's .NET technology.
Most ASP pages are written in VBScript, but any other Active Scripting engine can be selected instead by using the @Language directive or the <script language="language" runat="server">
syntax. JScript (Microsoft's implementation of ECMAScript) is the other language that is usually available. PerlScript (a derivative of Perl) and others are available as third-party installable Active Scripting engines.
Contents |
[edit] History
ASP was one of the first web application development environments that integrated web application execution directly into the web server. This was done in order to achieve high performance compared to calling external executable programs or CGI scripts which was the most popular method for writing web applications at the time it was introduced. Today there are additional platforms for web application development that are more common on other operating systems. Both JavaServer Pages and PHP are more commonly found on webservers running non-Microsoft operating systems, with PHP currently being the more common of the two. Also of note is ColdFusion, a popular Java technology running on several platforms including Microsoft servers as well as other platforms.
Prior to Microsoft's release of ASP for IIS 3, programmers relied on IDC and HTX files combined with ODBC drivers to display and manipulate dynamic data and pages running on IIS. The basics of these file formats and structures were used, at least in part, in the implementation of the early versions of ASP.
InstantASP and ChilisoftASP are technologies that run ASP on platforms other than the Microsoft Windows Operating System. ChilisoftASP was purchased by Sun Microsystems and later renamed "Sun ONE Active Server Pages", then later renamed to "Sun Java System Active Server Pages". It appears that InstantASP is no longer available. There are large open source communities on the internet, such as ASPNuke, which produce ASP scripts, components and applications to be used free under certain license terms.
[edit] Versions
ASP has gone through three major releases:
- ASP version 1.0 (distributed with IIS 3.0) in December 1996
- ASP version 2.0 (distributed with IIS 4.0) in September 1997
- ASP version 3.0 (distributed with IIS 5.0) in November 2000
ASP 3.0 is currently available in IIS 6.0 on Windows Server 2003 and IIS 7.0 on Windows Server 2008.
ASP.NET is often confused as the newest release of ASP, but the technologies are very different. ASP.Net relies on the .Net Framework and is a compiled language, whereas ASP is strictly an interpreted scripting language.
The move from ASP 2.0 to ASP 3.0 was a relatively modest one. One of the most important additions was the Server.Execute methods, as well as the ASPError object.[1] Microsoft's What's New in IIS 5.0 lists some additional changes.
There are solutions to run "Classic ASP" sites as standalone applications, such as ASPexplore, a software package that runs Microsoft Active Server Pages offline.
[edit] Sample usage
Several scripting languages may be used in ASP. However, the default scripting language (in classic ASP) is VBScript:
-
<html>
-
<body>
-
<% Response.Write "Hello World! How are you today?" %>
-
</body>
-
</html>
Or in a simpler format
-
<html>
-
<body>
-
<%= "Hello World!" %>
-
</body>
-
</html>
The examples above print "Hello World!" into the body of an HTML document.
Here's how to connect to an Access Database
-
<%
-
Set oConn = Server.CreateObject("ADODB.Connection")
-
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("DB.mdb")
-
Set rsUsers = Server.CreateObject("ADODB.Recordset")
-
rsUsers.Open "SELECT * FROM Users", oConn
-
%>
[edit] See also
[edit] References
- ^ 4 Guys From Rolla's A Look at ASP 3.0
- ^ All About ASP dot net
[edit] External links
- Ajaxed ASP Ajax Library
- W3 Schools - ASP Tutorials on ASP and ASP.net programming.
- ASP101- ASP Code & Tutorial Website
- PowerASP - ASP Code & Tutorial Website
- Beginning Active Server Pages 3.0 - Online Wiki Book
- Apache::ASP, provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded Perl code. There are also extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API.