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

Presented By: Yu, Zhu Time:2003.10.20

The document presents an overview of Active Server Pages (ASP) technology. It discusses why ASP was chosen, how it works, basic syntax rules, and its object model. An example management system for a chat room built with ASP is described. Limitations of ASP include that code can become repetitive and it lacks a good development environment. In summary, ASP provides an easy scripting interface and objects that simplify tasks like user state management and defining global variables for web applications.

Uploaded by

rajanikanth
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Presented By: Yu, Zhu Time:2003.10.20

The document presents an overview of Active Server Pages (ASP) technology. It discusses why ASP was chosen, how it works, basic syntax rules, and its object model. An example management system for a chat room built with ASP is described. Limitations of ASP include that code can become repetitive and it lacks a good development environment. In summary, ASP provides an easy scripting interface and objects that simplify tasks like user state management and defining global variables for web applications.

Uploaded by

rajanikanth
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

A S P

Presented by: Yu, zhu


Time :2003.10.20

Outline
The introduction of ASP
Why we choose ASP
How ASP works
Basic syntax rule of ASP
ASPS object model
An example of ASP (management system of chat
room)
Limitations of ASP
Summary

Introduction
What is the ASP
ASP (Active Server Pages) is a technology
developed by Microsoft. Pages using ASP are
primarily developed in JavaScript, VBScript , or
PerlScript and are integrated into the HTML of
your Web pages. The ASP code is compiled by the
server and the resulting output is standard HTML.
By using ASP, Web pages can be dynamic, full of
ever-changing content, and browser independent

Introduction (Cont.)
Here's the official word from the Microsoft site:
"Active Server Pages is an open, compile-free
application environment in which you can combine
HTML, scripts, and ActiveX server components to
create dynamic and powerful Web-based business
solutions. Active Server Pages enables server-side
scripting for IIS with native support for both
VBScript and Jscript." and the highest version of
IIS is IIS 5.0

Why we choose ASP

What can we do by using ASP


Server-side ASP scripts can be used to store HTML form
information in a database, personalize Web sites according
to visitor preferences, or use different HTML features
based on the browser.
separate the design of your Web page from the details of
programming access to databases and applications ,
allowing programmers and Web designers to focus on what
they do best.
Can call other programs to do things like access databases
, serve different pages to different browsers

Why we choose ASP (Cont.)


The benefits of ASP

ASP runs as a service of the Web server, and is optimized


for multiple threads and multiple users.
you can create ASP pages using whatever language you
want.
ASPs can also take advantage of COM and DCOM objects
with minimum effort.
Server-side scripts cannot be readily copied because only
the result of the script is returned to the browser; users
cannot view the script commands that created the page
they are viewing.

How ASP works

How ASP works (Cont.)


Have a look at the diagrams below. They are pretty simplistic and self-explanatory.

The Basic syntax rule of ASP


ASP contain the server scripts, which can contain
any expressions, statements, procedures,
operators valid for the scripting language. These
server scripts are enclosed by the delimiters <%
and %>
1. VBScript
2. JavaScript
3. Other Scripting Languages

ASPS object model


1.

Request Object
2. Response Object
3. Server Object
4. Session Object
5. Application Objects

An example of ASP
A management

system of a small chat room

In this management system of the chat


room, files are used to record the data. This
management system is used to kick out
some users.

An example of ASP

An example of ASP (source


code)
<%Response.Expires=0
manage=Session("hqtchatmanage")
if manage<>"Administrator" then Response.Write visit declined" : Response.end
username=Request.QueryString("username")
dim online()
onfile=server.mappath("online.asp") get the path of the online.asp
Set fs=CreateObject("Scripting.FileSystemObject")
establish the Filesystemobject objection and set the fs as the variable
Set thisfile = fs.OpenTextFile(onfile,1,False)
counton = 0
do while not thisfile.AtEndOfStream
thisline = thisfile.readline
Get a line of data from the file
Redim preserve online(counton) define an array
online(counton) = thisline
counton = counton + 1
loop

An example of ASP (source


code)
thisfile.Close
Set outfile = fs.CreateTextFile(onfile)
for i=0 to counton-1 step 3
if online(i)<>username then
If the user are not deleted
outfile.WriteLine online(i)
output all of the data of this user, and rewrite the
outfile.WriteLine online(i+1) data to the online.asp. And replace the original
outfile.WriteLine online(i+2) data of online.asp. So you can just see the users
end if
except the name of this user who was kicked out!
next
outfile.Close
Close this file
set fs=nothing
Response.Redirect "onlinelist.asp"
%>

An example of ASP (Cont.)

An example of ASP (Cont.)


This

function is achieved all by files instead


of the database. At first, establish a
temporary file folder (outfile). Output the
data of the users information such as
username, IP address and so on and store
in this folder. Then write into the file
(online.asp) that recorded the users
information orderly and replace the original
data in this file.

Limitations of ASP

Many of the functions of ASP will perform often in a data


driven website take several lines of repetitive code each
time to perform.
Sometimes, the code of ASP will become repetitive and is
somewhat time consuming.
ASP is the lack of a good development environment. ASP
is extremely robust, working well with the Windows
platform on many levels, but is often convoluted and finding
good support documentation and code examples can be
excruciating.
And if you are not proficient in Visual Basic or
programming, ASP is a very difficult language to learn.

Summary

ASP was designed as a faster and easier alternative


to CGI scripting using Perl or C. It provides an easyto-learn scripting interface (including native support
for VBScript and JScript), along with a number of
predefined objects that simplify many development
tasks, such as maintaining user state and defining
global variables within an application. ADO
components can be used to perform additional
functions, including accessing ODBC-compliant
databases, and outputting data to text files. Java
components and XML can be used to extend ASP
scripts

Reference

http://www.asp101.com/
http://www.aspin.com/
http://www.powerasp.com/
http://hotwired.lycos.com/webmonkey/98/39/index2a.html
http://www.asp-help.com/
http://www.webopedia.com/TERM/A/Active_Server_Pages.
html
http://www.aspronline.com/
http://www.oreilly.com/catalog/designasp/
http://www.codefixer.com/tutorials/how_asp_works.asp

Thank You for your time!

You might also like