- ASP scripts are compatible with any ActiveX scripting language and contain server extensions that are compatible with HTML.
- Developers may create the components to interface with the scripting engine to create new scripting languages.
- Server Side Scripting provides the structure for ASP.
- Application developers use scripting to provide input to components and may use a script for simple functions and calculations.
- ASP built on a scripting engine that exposes an object model for the Web application developer's use. VBScript—a subset of Visual Basic—is included with ASP to take advantage of the developer's knowledge of that programming model.
- Besides, JScript included in the default installation of ASP. JScript is a standard for scripting that is used in most contemporary browsers and is added to capitalize on the developer's knowledge of that language.
For enhanced performance and scalability, complex calculations and functions written with compiled languages by creating components to provide the desired functionality.
Active Server Pages (ASP) enables you to combine HTML, scripts, and reusable Microsoft ActiveX server components to create dynamic Web sites. ASP provides server-side scripting for IIS with native support for both Microsoft® Visual Basic® Scripting Edition and Microsoft® JScript™. Processing for ASP occurs on the server. The output of an ASP file is plain HTML customized for the Web browser.
Using ASP allows a Web developer to provide, with relatively little effort, dynamic content to users. The Web site can deliver content customized for that particular user based on user preferences, demographics, customer information, or a more fundamental criterion, like whether the user's Web browser can view content displayed in frames.
Easy Database Connectivity
The Active Data Object (ADO) component provides standard access to multiple data sources. IIS includes drivers for Microsoft® SQL Server™, Microsoft Access, and Oracle databases. Using Open Database Connectivity (ODBC), other databases supported.
The OLE DB further extends the ODBC standard to permit connection to various data sources. These data sources include Microsoft® Excel files, text files, log files, Microsoft® Exchange servers, indexed sequential access method (ISAM), virtual storage access method (VSAM), AS/400 and many other sources.
Scalable Server-Side Solution
The IIS administrator may choose to run all of the applications on the Web server in the same address space for scaling and efficiency. By default, IIS uses threads within the Web server's address space, instead of creating a new process for each user. The administrator can configure a single application to run in a separate memory space, to assure that a problem with one application will not impact the remaining Web applications on the server. Running applications in their memory space require additional memory.
Integrated State and User Management
Hypertext Transfer Protocol (HTTP) is a stateless protocol. The Web server does not maintain state information about the client. Creating dynamic applications requires state management, which ASP can provide. Using the Application and Session objects, the state of the application is available in both Application and Session scope. The Application object is a repository for information and objects that are available application wide. In this sense, they are ‘global‘ objects and data. The Session object maintains information on a per-user basis. A separate copy of the Session object created for each user of the application.
Reusable Software Model
ASP enables developers to reuse software components. Components may also be aggregated. For example, if a component provides 85 percent of the functionality required by an application, the developer may just capitalize on the functions of that component and only code the remaining 15 percent of the functionality required.
The script tag is used to indicate that the text enclosed in the tag is to be interpreted, not displayed and used on both the client and the server.
Client scripting is not Active Server Pages and is dependent on the browser for the implementation of any scripting language. Scripting language varies with browsers and may even vary within versions of the same browser. Client script is only mentioned here to differentiate from Active Server Pages and server-side scripting in general.
Script Tag for non-ASP Clients
The script tag for use within browsers is as follows:
<!—script commands -!>
The type of language supported, and the object model for the browser is browser specific.
Script Tag on Active Server Pages
Active Server Pages on the server use a similar tag, with a few changes. First, there must be a method to specify that the script is to run on the server and not to the client.
A script on an Active Server Page enclosed in the following tags:
<SCRIPT LANGUAGE=XXX RUNAT=SERVER>
Alternately, for convenience and to reduce the complexity of the scripted pages, the server side script tag may be shortened as follows:
In this case, notice that the script runs on the server and, therefore, is not browser-specific. The output of this script can display any content to the user