Active Server Pages, a.k.a. ASP, is a Microsoft® solution aimed at Web-based application development. It allows the combination of HTML, scripts, and ActiveX® components.

Having delivered tools that work with ASP, I'd like to say that they do work for delivering custom content. Basically when someone hits an ASP page, you run script on the server that dynamically generates the page. Embedded within the HTML on the server, the script tags <% and %> mark sections of script code that execute on the server, providing dynamic content to the page.

Mostly used for database query and display of the resulting recordsets. You can use Microsoft® Visual Basic® Scripting Edition (VBScript) or Microsoft® JScript (essentially JavaScript). Other languages such as Python and Perl may be used via plug-ins. Sun Microsystems copied ASP more or less wholesale to create JSP.

No matter what you think of MS, and I know most of you hate them, many corporate customers use their stuff. Being able to do basic ASP is valuable, especially since JSP is so alike, and more palatable for Java purists.

Nonetheless, we approach ASP projects with the following quote:

ASP? Very dangerous. You go first!

Active Server Pages is a server-side scripting technology that allows for session and application layer interactivity. The code is most commonly written in vbscript, which is based on visual basic, but can also be written in jscript, ecmascript or perlscript. It is made by Microsoft, and is a standard part of the IIS server and it's enhancements, including the Enterprise Server and SQL Server.

ASP is an object-oriented language. The core built in objects are: - Request object, which provides access to information about or passed with the HTTP request, including cookies and form entries. - Response object, which allows for the passing of data over http. This makes tasks such as redirection simple, and allows for direct output from the code. - Session, which allows for data to be retained throughout a session easily. - Application, which allows data to be passed between sessions or for actions to take place independent of user input. - Server, which allows for interaction with the file structure and services available on the server.

Other services will add other objects to the list, but these are the ones you'll refer to all the time for routine scripting.

Being a Microsoft product, ASP runs on Windows NT and Windows 2000 running IIS, however, some third party software now makes it possible to run it under other OSs.

One of ASPs big advantages is that it can be written inline with your HTML code. Any page with the '.asp' extension will be run through the ASP engine. HTML will be passed and ASP will be executed. To denote ASP code in your HTML file, you must enclose it in greater than/less than signs and percent signs, like this:

<% This is my ASP code %>

Since the code is run real time as the HTML is being passed, you can automate a lot of conditional output situations very easily:

<% If (variable1 = condition1) Then %>Output 1 <% Else %>Output 1<% End If %>

ASP code can also be invoked using this syntax:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
This is my ASP code
</SCRIPT>

Another useful feature of ASP is the global.asa file. When this file is in the root directory of a web site, you can write functions that will execute automatically whenever the application is started or terminated and whenever a session is started or terminated. This makes such things as keeping usage statistics or managing shopping carts very simple.
Ehem...

<%
   function inspiration (tool as String, salary as Double)
      select case tool
         case "vbscript+asp"
           toolvalue=0
         case "php+apache"
           toolvalue=10
      end select
      inspiration = toolvalue * salary
   end function
%> 
Running with values from my workplace...
debug.print inspiration("vbscript+asp", 800.00)
0

OK, back to work.. *sigh*...

I work for a big consulting firm, and I have used ASP extensively and routinely in financial services automation projects. In my opinion, the real value of ASP relies in its ability to script COM objects, so that you can write megabytes and megabytes of compiled code that is instantiated and invoked by a simple ASP page, showing the results. This makes it possible not to be limited by the inherent limits of a full scripting solution, and to interface with full security with the client's information system (based mostly on DB2's on OS/390).

This solution is often required because a lot of financial institutions have zillions and zillions of COBOL and Visual Basic code around, and it does make sense to re-use it as much as possible in order to minimize project developement costs and avoid reinventing already tested and often certified procedures. Also, it makes possible to re-use COBOL and Visual Basic programmers they already have on the job, and that cannot be easily trained to the worlds of Java and J2EE.

What is wrong with ASP, in my opinion, is that:

  • When using VBscript as the scripting language of choice, it's quite more painful to do the same things you'd do in, say, PHP or Perl;
  • When developing and often running projects, you sometimes find annoying memory leaks and sometimes known bugs that mean you have to reboot the production service, and this is quite annoying even in a web-farm environment, as ASP does not support dynamic migration of sessions around different servers (for instance, WebSphere does);
In the end, I believe ASP can be a viable and often used way to build complex projects in the real world. Ofcourse, Perl is by far more sexy!

Log in or register to write something here or to contact authors.