Active Server Pages has been enhanced with features that make it easier to use for scripters and Web application developers. Included in this article is a list of enhancements to ASP in Internet Information Server (IIS) version 5.0.
The Server object has two new methods to control program flow:Server.Transfer and Server.Execute. Rather than redirecting requests, which requires an expensive round-trip to the client, you can use these methods to transfer requests directly to an .asp file, without leaving the server.
ASP has a new feature for determining the exact capabilities of a browser. When a browser sends a cookie describing its capabilities (a cookie can be installed by using a simple client-side script), you can then create an instance of the Browser Capabilities Component that retrieves the browser's properties as returned by the cookie.
Configurable entries are moved to the metabase. The following IIS version 4.0 registry entries are now in the metabase:
You can also now use the HTML <SCRIPT></SCRIPT> tag's SRC attribute to do server-side includes. When you use the SRC attribute to specify a virtual or relative path and use the RUNAT=SERVER attribute to denote server-side execution, you can achieve the same functionality as the #Include directive.
ASP now supports a new script encoding utility provided with Microsoft Visual Basic(r) Scripting Edition (VBScript) and Microsoft JScript(r) 5.0. Web developers can apply an encoding scheme to both client and server-side scripts that makes unreadable the programmatic logic using standard ASCII characters. Encoded scripts are decoded at run time by the script engine, so there's no need for a separate utility. Although this feature is not intended as a secure, encrypted solution, it can prevent most casual users from browsing or copying scripts. For more information, visit the Microsoft Scripting Technologies Web site at http://msdn2.microsoft.com/en-us/library/ms950396.aspx
ASP self-tuning now senses when executing requests are blocked by external resources and automatically provides more threads to simultaneously execute additional requests and to continue normal processing. If the CPU becomes overburdened, ASP curtails the number of threads in order to reduce the constant switching that occurs when too many non-blocking requests are executing simultaneously.
Scriptless ASP pages do not adversely affect performance. With this latest release of ASP, the .asp files that do not contain server-side functionality are now processed more quickly than with IIS version 4. Thus, if you are creating an evolving Web application in which files may eventually require ASP functionality, you can now conveniently assign those files .asp file extensions, regardless of whether they contain static or server-side content.
You can use the new Server.GetLastError method to display useful information, such as an error description or the line number where the error occurred.
A Both-Modeled COM object which does not support the Free-Threaded Marshaller fails if it is stored in Application state. Both-Modeled components must aggregate the Free-Threaded Marshaller to be stored in Application state.
Transaction Flags IIS version 4.0 used the required, requires new, and not supported transaction flags to indicate that ASP was starting a new transaction. In IIS version 5.0, this behavior is unchanged. However, if an .asp file executes a transacted .asp file using the new Server.Execute or Server.Transfer methods, then the transaction flag state is maintained for the second .asp file. If the second .asp file's transaction flags indicate that transactions are supported or required, then the existing transaction is used and a new transaction will not be started.
Default Document Query String Behavior In IIS version 5.0, if an .asp (or .cdx) file is configured as the default document, it can now receive a query string from an URL that does not specify the default document. For example, the URLs http://www.microsoft.com/default.asp?newuser=true and http://www.microsoft.com/?newuser=true both send a query string value to the default .asp file.
Buffering is now on By Default. In IIS version 4.0, content buffering was off by default.
Response.IsClientConnected In IIS version 5.0, an .asp file can use the IsClientConnected property prior to sending content to the browser.
IIS uses a new Windows COM feature called cloaking to enable local server applications instantiated from an .asp file to have the security context of the originating client. In previous versions, the identity assigned to the local server COM object depended on the identity of the user who created the object instance.
In IIS version 4.0, COM objects were only released when ASP finished processing a page. In IIS 5.0, if a COM object does not use the OnEndPage method and the reference count for the object is zero, then the object is released prior to the completion of processing.