Sideway
output.to from Sideway
Draft for Information Only

Content

What is ASP?
 Examples
ASP Technology
ASP Document
 Examples
ASP Element
ASP Mechanism
ASP Additional Information

What is ASP?

ASP is .........

  • ASP stands for Active Server Pages
  • ASP is a server side scripting technology from Microsoft.com
  • ASP files use the extension ".asp" to activate the supported web server to interpret the scipts in the ASP files
  • ASP uses delimiters "<%" and "%>" as markup tags to specify the beginning and end of the enclosed script commands.

Examples

Examples Of ASP code
ASP VbScript Command:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
<% Response.Write ("<h1>ASP Sample</h1>") %>
    </body>
</html>
HTTP Response Output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
<h1>ASP Sample</h1>
    </body>
</html>
HTML Web Page Embedded Output:

ASP Technology

ASP technology is a server side techonogy to interpret scripts: vbscript, jscript and activeX script: ASP objects and ASP components.

image

ASP Document

Basic Features of ASP files.........

  • ASP file is a HTML document with extension ".asp" to describe web pages
  • ASP file is just a HTML document with script commands enclosed by delimiters "<%" and "%>"
  • ASP technology is just an additional scripting engine that allows script command running on the server side. 
  • HTML document contains HTML tags and plain text without script command can also be an ASP file by renaming the extension to ".asp"
  • ASP technology also enables both ActiveX scripts and ActiveX server components running on the server.

Examples

Examples of ASP page
ASP VbScript Command:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
        <% Response.Write ("<h1>This is a Sample ASP Page</h1>") %>
    </body>
</html>
HTTP Response Output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
        <h1>This is a Sample ASP Page</h1>
    </body>
</html>
HTML Web Page Embedded Output:

ASP Element

Similar to a html commenting element enclosed by delimiters "<!--" and "-->", ASP elements in a ASP files are enclosed by delimiters "<%" and "%>". ASP elements can also be inserted anywhere in a ASP file provided that the output is logically correct.   Since ASP scrips are only additional script commands to enhance the dynamicity of a web page, ASP element is not a necessary element in a ASP file. The simplest ASP file is a plain html file without any ASP element.

An ASP element is an element with script

<%

...

Script command: vbscript, jscript, ...

...

ActiveX script:  e.g. Set Conn = Server.CreateObject("ADODB.Connection")

...

ASP objects: Request object, Response object, Server object, ...

...

ASP components: e.g. AdRotator components

...

%>

Besides, in order to increae the flexibility of ASP scripting, ASP technology support the feature of server-side # include directives also allow inserting the content of another file into the ASP file before processing by the web server. And the ASP technology also allow adding one single line @ processing directives, which should be the first command of the ASP page, including server-side script, and is usually  located at the first line of the ASP page,  to send information to web server for controlling how the ASP file to be interpreted by the server. The @ processing directives commond can also be placed in the included file using # include directive, providing that the @ processing directives commond is the first command within the ASP page including inserted files.  As the ASP technology is usually used for developing web application, an optional Global.asa file is available for declaration and storing session and application information of the ASP application globally at the application level, which can be accessed by every page in an ASP application. Therefore each application can only have one Global.asa file and the Global.asa file should be stored in the root directory of the ASP application also. The Global.asa file of an application can only be triggered through an ASP page request of the application. Once the Application_OnStart procedures of the Global.asa file is processed, the Global.asa file can only be restarted after the completion of the Application_OnEnd procedures when the application quits unless the Global.asa file is refreshed after modification, or the Application_OnStart or Session_OnStart events are triggered, or the application is restarted through the stopping and starting the web server or the application. 

ASP Mechanism

The mechanism of ASP engine in the IIS, tested with vbscript and jscript, may be processed as the following order:

  1. When there is an ISAPI filter intalled on the web site, the ISAPI filters are processed. This is also applied to all applications. And ASP pages are also processed through an ISAPI extension, ASP.dll. The ASP engine of the web server is only triggered by the requested file of a HTTP request with a filename extension of ".asp". In general, the web server will pass the control of a ASP file to the ASP engine. If a Global.asa file is located at the root directory, the Global.asa of the application will be processed is the Global.asa file is not running.

  2. The ASP file will be read and cached by the ASP engine. The starting procedure of the ASP page processing processed by the ASP engine is to reformat the cached ASP file to a cached intermediate page by inserting the included file to the cached intermediate page, reformat the ASP script according to the default scripting language and extracting the server-side script block from the intermediate page according to the sequence of the lines while the static HTML codes and the client-side scripts, which be treated as static HTML codes, are retained in the cached intermediate page remiains unchanged. The inserted included file will be  processed immediately after inserting. The reformat process will only check and reformat the ASP code blocks within the delimiters <%...%> to proper script statement according to the default scripting language while all server-side <script> blocks are seperated from the ASP code blocks for later processing. However only the location of the code block of the ASP script will be marked in the cached intermediate page. Since the ASP @processing directives must be the first command within the ASP page, if the first ASP command is @processing directives, then the @processing directives will be processed and be interpreted first to check all processing directives setup to be used for the ASP page, including all included files. The  @processing directives will not be kept in the cached intermediate page. Once the default scripting language of the ASP page is confirmed, the syntax error of the ASP code blocks  within the delimiters <%...%> can then be detected by ASP engine according to specify default scripting language. If there is no @ language directive, the ASP code will use vbscript as the default scripting language.

  3. After the completion of reformat the ASP code block, the ASP engine will then continue to check and reformat all server-side <script> blocks with the default scripting language only because there is no need to switch the working script language of the ASP engine. the syntax error of all server-side <script> blocks with the default scripting language can then be detected by ASP engine according to specify default scripting language.

  4. After the completion of check and reformat the server-side <script> blocks with the default scripting language, the ASP engine will then continue to check and reformat all server-side <script> blocks with one type of non-default scripting language. Because of compatibility, the working script language of the ASP engine will switch the same non-default scripting language so that the syntax error of all server-side <script> blocks with the same non-default scripting language can be detected by ASP engine according to the same non-default scripting language.

  5. In order in to reduce the number of switching the working script language of the ASP engine, the server-side <script> blocks of the same type of non-default scripting language will be interpreted before used.  All coding errors in the server-side <script> blocks with the same non-default scripting language can be detected accordingly. The server-side <script> blocks with non-default scripting language can call functions in server-side <script> blocks with the same non-default scripting language because these functions can be interpreted immediately. However, the server-side <script> blocks with the non-default scripting language cannot call function in server-side <script> blocks with the default scripting language because these server-side <script> blocks have not been interpreted and the ASP engine cannot switch the work scripting language immediately. During interpretation, any response output will be responsed to the ASP response buffer by the ASP engine immediately.

  6. Similarly, may be these proceduces can be used to repeat with another type of non-default scripting language when there are other server-side <script> blocks with other different types of non-default scripting language by switching the working script language of the ASP engine to the same type of non-default scripting language. However this scenario is not tested,

  7. After the completion of check, reformat, and interpretation of all server-side <script> blocks with non-default scripting language, the ASP engine begins to response the static HTML codes and the client-side scripts in the cached intermediate page to the ASP response buffer directly and to response the results of all ASP code blocks in the cached intermediate page after interpretation following the sequance codes in the cached intermediate page. All coding errors in the ASP code blocks with the default scripting language can be detected accordingly. Therefore the results of the all ASP code blocks can also be inserted to the static HTML codes accordingly.

  8. Besides, both the ASP code blocks and the server-side <script> blocks with default scripting language can call functions in server-side <script> blocks with the same default scripting language because these functions can be interpreted immediately whenever necessary and call functions in server-side <script> blocks with the non-default scripting language because these functions have already been interpred before. However, unlike the server-side <script> blocks with the non-default scripting language, only the related code block of the called function in the server-side <script> blocks with the default scripting language will be interpreted and the other unrelated codes of the server-side <script> blocks will not be interpreted.

  9.  After the completion of interpretation of all ASP code blocks with default scripting language, the ASP engine begins to interpret the server-side <script> blocks with the default scripting language. Similarly, during interpretation, any response output will be responsed to the ASP response buffer by the ASP engine immediately.

  10. Because of the unexpected sequence of processing the <SCRIPT> element due to the complexity of the script arranged by the ASP engine, the ASP page mixed with server-side <SCRIPT> blocks and ASP code blocks within delimiters <% ... %>, might be not processed as the about mention sequence, therefore the <SCRIPT> element is usually used for containing procedures and functions only. Besides, the client-side script will be interpreted on the browser according to the sequence of the HTML code.

ASP Additional Information

ASP additional information ..........


©sideway

ID: 120100020 Last Updated: 12/23/2017 Revision: 2 Ref:

close

References

  1. Active Server Pages,  , http://msdn.microsoft.com/en-us/library/aa286483.aspx
  2. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx
  3. ASP Best Practices,  , http://technet.microsoft.com/en-us/library/cc939157.aspx
  4. ASP Built-in Objects,  , http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx
  5. Response Object,  , http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx
  6. Request Object,  , http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx
  7. Server Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx
  8. Application Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx
  9. Session Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx
  10. ASPError Object,  , http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx
  11. ObjectContext Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx
  12. Debugging Global.asa Files,  , http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx
  13. How to: Debug Global.asa files,  , http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx
  14. Calling COM Components from ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx
  15. IIS ASP Scripting Reference,  , http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx
  16. ASP Keywords,  , http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx
  17. Creating Simple ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx
  18. Including Files in ASP Applications,  , http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx
  19. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx
  20. FileSystemObject Object,  , http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  , ADO Object Model
  22. ADO Fundamentals,  , http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339new

Travel 7new

Reference 79

Computer

Hardware 251

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 431

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019