Monday, May 26, 2008

ASP Introduction

INTRODUCTION

  • ASP stands for Active Server Pages
  • ASP is a program that runs inside IIS (Internet Information Services)
  • An ASP file can contain text, HTML, XML, and scripts
  • Scripts in an ASP file are executed on the server

You can run ASP on your own PC without an external server. To do that, you must install Microsoft's Personal Web Server (PWS) or Internet Information Services (IIS) on your PC.

The default scripting language is VBScript. To set JavaScript as the default scripting language for a particular page you must insert a language specification at the top of the page. Like this: asp delimiter @ language="JavaScript" asp delimiter


Execution: When a browser requests an ASP file, IIS passes the request to the ASP engine. The ASP engine reads the ASP file, line by line, and executes the scripts in the file. Finally, the ASP file is returned to the browser as plain HTML.

Advantages of ASP:

• Minimizes network traffic by limiting the need for the browser and server to talk to each other
• Makes for quicker loading time since HTML pages are only downloaded
• Allows to run programs in languages that are not supported by the browser
• Can provide the client with data that does not reside on the client’s machine
• Provides improved security measures since the script cannot be viewed by the browser

Difference between server side scripting and client side scripting:

Scripts executed only by the browser without contacting the server is called client-side script. It is browser dependent. The scripting code is visible to the user and hence not secure. Scripts executed by the web server and processed by the server is called server-side script.

Order of execution for an ASP application:
1) Global.asa

2) Server-side Includes statements

3) Directives

4) Jscript scripts tagged within SCRIPT tags

5) HTML together with scripts tagged within asp delimiters

6) VBScripts tagged within SCRIPT tags

In a simple way, order of scripts is defined as (points 4, 5, 6 above) scripts in non-default language scripts using asp delimiter scripts in default language
ILLUSTRATION:


No comments: