0% found this document useful (0 votes)
766 views

Active Server Pages (ASP)

Active Server Pages (ASP) is a Microsoft technology that enables the creation of dynamically-generated web pages. ASP pages contain HTML markup, scripts, and code that runs on the server to access databases and generate customized page output. ASP files have a .asp extension and are executed by Internet Information Services (IIS) on the server. When a client requests an ASP page, the ASP scripts are run on the server and the output is sent to the browser as a standard HTML page. Common ASP scripts interact with databases, generate personalized content, and respond to form submissions from users.

Uploaded by

Shivam Gandhi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
766 views

Active Server Pages (ASP)

Active Server Pages (ASP) is a Microsoft technology that enables the creation of dynamically-generated web pages. ASP pages contain HTML markup, scripts, and code that runs on the server to access databases and generate customized page output. ASP files have a .asp extension and are executed by Internet Information Services (IIS) on the server. When a client requests an ASP page, the ASP scripts are run on the server and the output is sent to the browser as a standard HTML page. Common ASP scripts interact with databases, generate personalized content, and respond to form submissions from users.

Uploaded by

Shivam Gandhi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

Active Server Pages (ASP)

What is ASP?
 Active Server Pages also known as Classic ASP or ASP
Classic.
 ASP is a Microsoft's first server-side script
engine for dynamically-generated web pages.
 Initially released as an add-on to Internet Information
Server/Services (IIS) via the Windows NT 4.0 Option
Pack (1998) .
 Then subsequently included as a free component of
Windows Server (since the initial release of Windows 2000
Server)
 ASP is a program that runs inside IIS
(Internet Information Server/Services)
 A series of objects and components that are executed on
the web server.
 A Control of how content is generated from the server to the
browsers (client-server communication)
An ASP file
 An ASP file is just the same as an HTML
file
 An ASP file can contain text, HTML, XML,
and scripts
 Scripts in an ASP file are executed on the
server
 An ASP file has the file extension ".asp"
Internet Information Server (IIS)

 IIS is a set of Internet-based services for


servers created by Microsoft for use with
Microsoft Windows.
 IIS comes with Windows 2000, XP, and
Vista. It is also available for Windows NT.
 IIS is easy to install and ideal for
developing and testing web applications.
HTML Page Execution
You Request an HTML Page
www.ocstc.org/resumes.htm

Server finds and downloads the page

Browser displays the page


ASP Page Execution

You Request an ASP Page through


browser www.ocstc.org/default.asp

IIS forwards the request to ASP engine

ASP Engine executes ASP commands, converts ASP to


HTML/XML as needed, processes HTML/XML

Browser displays the page


Versions of ASP
ASP has gone through three major releases:
 ASP version 1.0 (distributed with IIS 3.0) in
December 1996
 ASP version 2.0 (distributed with IIS 4.0) in
September 1997
 ASP version 3.0 (distributed with IIS 5.0) in
November 2000
 As of 2010 ASP 3.0 is available in IIS 6.0
on Windows Server 2003 and IIS 7.0 on Windows
Server 2008.
ASP vs. ASP.NET
Many people regard ASP.NET as the newest release
of ASP, but the two products use very different
technologies. ASP.NET relies on the .NET
Framework and is a compiled language, whereas
ASP is strictly an interpreted scripting language.
ASP Compared to Other Scripting Languages
 ASP and /PHP/Perl/CGI execution are
roughly equivalent in execution sequence.
 Compared to VBScript, ASP does not have
to worry about browser incompatibility.
 Compared to JavaScript, don’t have to
worry about browser versions or disabling.
 Compared to Java, don’t have to worry
about whether JRE (or MVM) is installed.
ASP in the Microsoft Language Family
 The ASP commands...

Visual Basic

VBScript ASP

Some characterize ASP as “more or less server-side


VBScript”
ASP in the Microsoft Language Family

 ASP can also interact with other Microsoft


languages or applications:
 Execute SQL commands
 Open and close databases
 Create and Modify database tables
 Control applications or COM objects written or
compiled in other languages (VB, C++, Java)
 Extract content from Excel or Word
 Control an XML document
Uses of ASP
 Dynamically edit, change, or add any content of
a Web page
 Respond to user queries or data submitted from
HTML forms
 Access any data or databases and return the
results to a browser
 Customize a Web page to make it more useful
for individual users
 The advantages of using ASP instead of CGI
and Perl, are those of simplicity and speed
 Provide security - since ASP code cannot be
viewed from the browser
What Does ASP Look Like in Action?
Tools required to Create ASP Applications

 Web Server that Supports ASP


 Microsoft Internet Information Server (IIS)—
Web services of Windows NT Server 4.0 and
Windows 2000 Server
 Microsoft Personal Web Server (PWS)—
Creates a fully functional subset of IIS 4.0
that can run on all other Windows OS
 PWS is an add-on for Windows NT, 95/98/Me
 Built-in to Windows 2000/XP PROFESSIONAL

 Fundamental knowledge of Visual Basic


Tools required to Create ASP Applications

 If you are working with database


storage/retrieval
 Knowledge of Access, SQL Server, etc. (to
create databases and tables)
 Knowledge of SQL commands (or at least
how to use Access to generate SQL
statements)
 Knowledge of the VB style of data handling
ASP Syntax & Semantics
ASP Syntax
 An ASP file normally contains HTML tags, just like
an HTML file. However, an ASP file can also
contain server scripts, surrounded by the delimiters
<% and %>.
 Server scripts are executed on the server, and can
contain any expressions, statements, procedures,
or operators valid for the scripting language you
prefer to use.
 The response.write command is used to write
output to a browser. The following example sends
the text “Hi !! This is my first ASP" to the browser:
Example
<html>
<body>
<% response.write(" Hi !! This is my first ASP ") %>
</body>
</html>

There is also a shorthand method for the response.write


command. The following example also sends the text “Hi !!
This is my first ASP” to the browser:
<html>
<body>
<%= “Hi !! This is my first ASP” %>
</body>
</html>
ASP Code Construction
 To get output :
<%= X %> or
<% response.write(" Hi !! This is my first ASP ") %>
 Code Block : <% code %>
 <script> code </script>
 We can have ASP within HTML and the vice versa.
 Processing directives : <%@ LANGUAGE=VBscript %>
 Including a file : <script> #include file= “myadditionalfile.inc” </script>
 Adding comments : ‘ this is the comment line1
‘ this is the comment line 2
 Declaring variable : Dim salary
ASP Object Model
ASP Object Model
 ASP itself is not Object-Oriented. ASP can
use objects but cannot define new objects
 Composed of
5 objects
 5 components
ASP Object Model
Server
Request ASP.DLL
YOU (if it finds <%%>, invokes
Scripting Objects Component)

Response

Application
Session
ASP Objects
ASP Objects
 Request
 Response
 Server
 Application
 Session
ASP Components
ASP Components
 Scripting Objects Component
 ADO (ActiveX Data Objects) Component
 Ad Rotator Component
 Browser Capabilities Component
 Content Linking Component
Major Sites Using ASP
 Microsoft
www.microsoft.com
 NASDAQ
www.nasdaq.com
 Beckman Coulter
www.beckmancoulter.com
 PC-Mac Connection
www.pcconnection.com
 Ticketmaster
www.ticketmaster.com
 State Farm and Allstate Ins. Companies
www.statefarm.com / www.allstate.com
Installing IIS
How to Install IIS on Windows XP and Windows 2000

Follow these steps to install IIS on Windows XP and


Windows 2000:
 On the Start menu, click Settings and select Control
Panel
 Double-click Add or Remove Programs
 Click Add/Remove Windows Components
 Click Internet Information Services (IIS)
 Click Details
 Select the check box for World Wide Web Service, and
click OK
 In Windows Component selection, click Next to install IIS
Test Your Web
After you have installed IIS follow these steps:
 Look for a new folder called Inetpub on your hard drive
 Open the Inetpub folder, and find a folder
named wwwroot
 Create a new folder, like "MyWeb", under wwwroot
 Write some ASP code and save the file as "test1.asp" in
the new folder
 Make sure your Web server is running (see below)
 Open your browser and type
"http://localhost/MyWeb/test1.asp", to view your first web
page
 Note: Look for the IIS (or PWS) symbol in your start
menu or task bar. The program has functions for starting
and stopping the web server, disable and enable ASP,
and much more.
ASP Reference Tools
 ASP Reference Books
 ASP Developer’s Guide, by Greg Buczek
ISBN: 0-07-212274-3
 Beginning Active Server Pages, by Francis et al
ISBN: 1-861001-34-7*
 Professional Active Server Pages, by Francis et al
ISBN: 1-861001-26-6*

* Online version of this book is on the Microsoft Web site


http://www.microsoft.com/TechNet/iis/books.asp

You might also like