The way ASP works is that a client (web browser) begins by requesting an .asp page from a website or virtual directory on IIS. When the server receives the HTTP request, it passes the request to the ASP script interpreter, an ISAPI extension called asp.dll. This interpreter then processes the script and generates an HTML response for the client and/or performs some other action such as calling a COM component in order to write a record to a database.
ASP.NET is a brand new programming model from Microsoft for developing dynamic web applications for IIS 6. ASP.NET is more than just a new version of ASP. It incorporates important features of Microsoft’s new .NET Framework, such as the common language runtime (CLR), which allows ASP.NET applications to make use of inheritance, type safety, versioning, and language interoperability, and enabling ASP.NET applications to be more robust, scalable, and reliable than legacy ASP applications. ASP.NET also supports the latest web standards such as Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP), which makes ASP.NET an ideal platform for developing enterprise-class web services.
ASP.NET supports many more programming languages than ASP, making it a much more flexible development environment. Among the languages ASP.NET natively supports are VB.NET, JScript.NET, and C#. ASP.NET recognizes most ASP code, too, which makes it relatively easy to migrate, legacy ASP applications to the ASP.NET platform. ASP also supports COM+, the latest version of Microsoft’s architecture for developing distributed applications.
In addition to these improvements, ASP.NET simplifies the process of building applications by providing server controls for displaying data, validating, user input, and other common tasks. These controls generate HTML code that works with any web browser and enable ASP.NET applications to be written faster and with less code than legacy ASP applications. Using Visual Studio.NET, you can rapidly build and deploy ASP.NET applications with the same ease with which you can create VB applications. For example, you can visually design a Web Form by dragging and dropping controls onto the page and double-clicking them to configure their parameters. This is indeed cool.
Other advantages of ASP.NET over ASP include:
- Easier deployment Simply copy your ASP.NET files to your web server. You don’t even need to restart the server to get your application up and running.
- Better performance ASP.NET runs as compiled code, it’s not interpreted like ASP. This can significantly improve the performance of your web applications.
- Flexible caching ASP.NET can cache entire pages or portions of pages as needed to increase application responsiveness.
- Better internationalization ASP.NET uses Unicode (UTF-8) internally for representing request/response data.
- Easier debugging ASP.NET includes a tracking feature that makes it easier to debug faulty applications.
- Easier configurability ASP.NET configuration settings are stored in text files and formatted in XML for easy editing.
- Web farm session state ASP.NET lets multiple IIS servers in a web farm share session state information for a single application, making IIS more scalable.
- Improved crash protection ASP.NET automatically detects memory leaks and deadlocks and tries to recover from them with no intervention needed.
- Support for .NET Framework This support includes .NET class library, Web Forms, and XML Web Services.
Internet Server Application Programming Interface (ISAPI) was created by Microsoft as a replacement for the CGI processing model popular on UNIX web server platforms. ISAPI really represents two kinds of routines:
- ISAPI applications These can be called from any web page to perform dynamic and interactive functions like accessing a database or validating a form. Another name for these is ISAPI extensions, because ISAPI can extend the functionality of IIS beyond serving static HTML and do things similar to what ASP applications do (only faster). ISAPI applications can be written in several different languages but are usually written in C++ for best execution performance. ISAPI applications can be configured at either the web site or virtual directory level, so a single web site may have multiple ISAPI applications running in different directories performing different application-related tasks when they are called.
- ISAPI filters These are used to preprocess and post-process HTTP requests and perform actions such as compressing or encrypting information, performing redirection, monitoring security, and so on. ISAPI filters are always written in C++, as they usually examine all incoming traffic for your site and so have to be built for speed. ISAPI filters are always configured at the web site level—you can’t configure an ISAPI filter for a virtual directory within a site.
The main advantage of ISAPI over CGI is that it avoids the performance penalty incurred by CGI, which spawns a new process each time code is run. However, the problem with the ISAPI model is that you need C++ or similar high-level programming knowledge to develop ISAPI applications and filters, while CGI apps are commonly written using Perl or some other interpreted scripting language. Because of the development cost of writing C++ code, Microsoft developed the simpler ASP model described earlier that is more widely used than ISAPI.
The Common Gateway Interface (CGI) is a programming model originally developed for web servers running on the UNIX platform. CGI programs are typically either scripts written in Perl, Python, or some other scripting language, or executables written in C or C++. On UNIX web servers, these programs are usually placed in the cgi-bin directory on your web server and called from web pages for performing tasks such as processing input from forms or writing a record to a database. IIS supports CGI mainly to simplify the process of migrating applications from UNIX to IIS.