活动服务器页面(ASP),之后叫经典ASP或者ASP经典的比较多,是微软第一个服务器端动态生成的网页。ASP.NET,在2002年一月份首次发布,取代了ASP。

历史
Initially released as an add-on to Internet Information Services (IIS) via the Windows NT 4.0 Option Pack (ca. 1996), it is included as a free component of Windows Server (since the initial release of Windows 2000 Server). There have been three versions of ASP, each introduced with different versions of IIS:[1]
通过Windows NT 4.0选项包(约1996)是最初作为添加到Internet Information Services(IIS)发布的,它是包含在Windows Server的一个免费的组件(因为Windows2000服务器的初始版本)。目前ASP已经有了三个版本,每一个都介绍了不同的版本的IIS:[1]

ASP 1.0在1996年12月份发布了IIS 3.0
ASP 2.0 在1997年9月份发布了IIS 4.0
ASP 3.0在2000年11月份发布了IIS 5.0
ASP 2.0 提供了6个内置对象: 应用程序, ASP错误, 请求, 响应, 服务器和会话控制. 比如会话控制对象,代表了一个会话一页一页地保持变量的状态.[2] 该活动脚本引擎的支持组件对象模型(COM)启用了ASP网站访问编译库比如DLL的功能。
ASP3.0跟ASP2.0没有很大的不同,但它确实提供了一些额外的增强功能,如Server.Transfer方法,使用Server.Execute方法,以及增强的ASP错误对象。 ASP3.0在默认情况下还能启用缓冲,优化成了更好的性能。
在Windows7下ASP会一直被支持到2020年1月14日。[3] 从Windows8发布日期的至少10年期间,在Windows8下使用ASP页面都会一直被支持。[3]

架构
ASP能使用服务器脚步生成被发送到访问者的网页浏览器的内容。ASP程序员读取和执行在<% and %> 标签之间所有脚本代码,其结果是内容生成。这些脚本是使用的VBScript, JScript 和PerlScript写成的。@Language 指示, the <script language="manu" runat="server" /> 句法或者配置能被使用来选择语言。在下面的例子中,Response.Write Now()是一个HTML页面;它将由服务器的当前时间来动态地替换。
服务器端                    客户端接收的内容
服务器当前时间:<br />             服务器当前时间:<br />
8/11/2015 6:24:45 PM
<%
Response.Write Now()
%>

带有.asp的文件扩展名的网页使用ASP,虽然有些网站为了安全起见通过使用比较常见的.htm或.html扩展名掩饰自己选择的脚本语言。带有.aspx扩展名的页面使用编译的ASP.NET;然而,ASP.NET页面可能仍包含一些ASP脚本。引入ASP.NET引起了使用最初的ASP技术。

ASP只能在Windows上运行。有很多产品都模仿了非Microsoft Web服务器的功能。Apache: ASP例如ASP发送到Apache Web服务器,但只能解释Perl脚本。[4]
Sun Java System ASP (formerly ChiliSoft ASP) was a popular and reportedly complete emulator,[5] but it has been discontinued.
Sun Java System ASP(前身是ChiliSoft ASP)是一种流行的,据说是完全仿真的系统,[5],但它已经停产。

请求对象
允许数据被读取,发送到客户端浏览器:表单,查询字符串和HTTP Cookie。它还提供服务器的信息,客户端浏览器,并检索存储在访问者的机器上的HTTP Cookie。可以检索使用这两种方法的HTTP表单数据:
Request.Form reads data sent by POST.

Request.QueryString reads data sent by GET.

<%
Response.Write("Welcome " & Server.HTMLEncode(Request.QueryString("name")) & "!")
%>
响应对象
发送信息到客户端,比如在页面或者HTTP Cookie写入文本。
<%
If (Len(Request.QueryString("name")) > 0) Then
     Response.Cookies("name") = Request.QueryString("name") 
End If

Response.Write "Welcome " & Server.HTMLEncode(Response.Cookies("name")) & "!"
%>


<%
If (Len(Request.QueryString("name")) > 0) Then
     Response.Cookies("name") = Request.QueryString("name") 
End If

Response.Write "Welcome " & Server.HTMLEncode(Response.Cookies("name")) & "!"
%>
服务器对象
允许连接数据库(ADO),文件系统和使用安装在服务器上的组件。
<%
Dim oAdoCon, oAdoRec, oAdoStm, oCdoCon, oCdoMsg, oSciDic, oSciFsm, oMswAdr

Set oAdoCon = Server.CreateObject("ADODB.Connection")
Set oAdoRec = Server.CreateObject("ADODB.Recordset")
Set oAdoStm = Server.CreateObject("ADODB.Stream")
Set oCdoCon = Server.CreateObject("CDO.Configuration")
Set oCdoMsg = Server.CreateObject("CDO.Message")
Set oSciDic = Server.CreateObject("Scripting.Dictionary")
Set oSciFsm = Server.CreateObject("Scripting.FileSystemObject")
Set oMswAdr = Server.CreateObject("MSWC.AdRotator")
%>
应用程序对象edit]
存储全局变量
<%
Application("Ali") = "My ASP Application"
Response.Write("Welcome to " & Server.HTMLEncode(Application("Ali")) & "!")
%>
会话控制对象
存储变量只能访问一个单一的访问者。
<%
If (Len(Request.QueryString("name")) > 0) Then
     Session("name") = Request.QueryString("name") 
End If

Response.Write("Welcome " & Server.HTMLEncode(Session("name")) & "!")
%>
错误对象
允许错误管理
<%
On Error Resume Next

Dim o_Error
Set o_Error = Server.GetLastError()

Response.Write("Asp Code: " & Server.HTMLEncode(o_Error.AspCode) & "<BR />")
Response.Write("Asp Description: " & Server.HTMLEncode(o_Error.AspDescription) & "<BR />")
Response.Write("Category: " & Server.HTMLEncode(o_Error.Category) & "<BR />")
Response.Write("Column: " & Server.HTMLEncode(o_Error.Column) & "<BR />")
Response.Write("Description: " & Server.HTMLEncode(o_Error.Description) & "<BR />")
Response.Write("File: " & Server.HTMLEncode(o_Error.File) & "<BR />")
Response.Write("Line: " & Server.HTMLEncode(o_Error.Line) & "<BR />")
Response.Write("Number: " & Server.HTMLEncode(o_Error.Number) & "<BR />")
Response.Write("Source: " & Server.HTMLEncode(o_Error.Source) & "")

If (Err.Number <> 0) Then 
     Err.Clear 
End If 
%>