Another milestone technology—one discussed extensively in this book—is Active Server Pages, or ASP. In many ways, ASP is the most exciting of all the new Internet technologies because it allows you to create great, platform-independent content that can be used in any browser. Or, if you want to take maximum advantage of platform-specific technologies such as Dynamic HTML, you can create ASP pages that speak directly to Internet Explorer 4.0.
At its most fundamental, ASP is scripting done on the server. This scripting code is evaluated dynamically when the page is
Listing 1-6. An ASP Web page.
<%@SCRIPT LANGUAGE="VBSCRIPT"%> <HTML> <HEAD> <METANAME ="GENERATOR" Content="Microsoft Developer Studio"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>ASP Example</TITLE> </HEAD> <BODY BGCOLOR="WHITE"> <%For x = 1 to 6%> <FONT FACE="ARIAL" SIZE=<%=x%>> ActiveX Is Cool! </FONT> <P> <%Next%> </BODY> </HTML>
The sample code includes a <SCRIPT> tag, but notice that percent signs appear inside the brackets. This syntax indicates that the code is to be executed on the server before the page is downloaded to the client. In fact, notice the percent signs that surround all the code in the page. This code is all evaluated before the browser receives the page. The resulting HTML code looks like this:
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Developer Studio"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>ASP Example</TITLE> </HEAD> <BODY BGCOLOR="WHITE"> <FONT FACE="ARIAL" SIZE=1> ActiveX Is Cool! </FONT> <P> <FONT FACE="ARIAL" SIZE=2> ActiveX Is Cool! </FONT> <P> <FONT FACE="ARIAL" SIZE=3> ActiveX Is Cool! </FONT> <P> <FONT FACE="ARIAL" SIZE=4> ActiveX Is Cool! </FONT> <P> <FONT FACE="ARIAL" SIZE=5> ActiveX Is Cool! </FONT> <P> <FONT FACE="ARIAL" SIZE=6> ActiveX Is Cool! </FONT> <P> </BODY> </HTML>
In the resulting HTML lies the beauty of Active Server Pages. ASP output can be limited
The heart and soul of any good Web site is the back-end server.
The Web server can provide static Web pages in the form of HTML
documents, but it can also execute applications that significantly
enhance the content of a site. The idea of executing content on a
Web server is not new. In past