Internet Information Server
The Microsoft Internet Information Server is a web server that supports the standard Unix web-server scripting technique called the Common Gateway Interface (CGI). In addition to CGI, IIS also supports Active Server Pages (ASP), which use Active Scripting to implement a richer scripting model than offered by CGI.
Active Server Pages uses a scheme to embed the script code that is
similar to Internet Explorer. Code is still delimited with
<SCRIPT>
tags, but the tag has a
RunAt=Server
attribute added. For example:
<SCRIPT RunAt=Server Language=Python> # This code will run at the server </SCRIPT> <SCRIPT Language=Python> # This code will run at the client </SCRIPT>
Although this sounds simple, the complication again is that the
object model exposed by ASP is quite different to that exposed by IE.
If you attempt to call the
alert()
function, your code fails as
alert()
doesn’t exist in the ASP object
model.
In addition to using <SCRIPT>
tags, ASP
allows alternative forms delimited by <% %>
and <%= %>
tags. Script code delimited by
<%
and %>
tags are almost
identical to those delimited by <SCRIPT>
tags. The <%= %>
tag allows you to specify
arbitrary Python expressions, and the result of the expression is
replaced in the output. For example, if ASP encounters HTML of the
form:
Hello <%= name %>
The value of the name
variable is printed in the
output sent to the client.
The source files for Active Server Pages are stored as .asp files, although for all intents ...
Get Python Programming On Win32 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.