ASP I - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

ASP I

Description:

VBScript --OBJECTS RESPONSE & WRITE --Variables. ASP- All Inclusive Tutorial ... Two most popular scripting languages for ASP are VBScript and Jscript ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 18
Provided by: hollych
Category:
Tags: asp | vbscript

less

Transcript and Presenter's Notes

Title: ASP I


1
ASP I
  • Topics
  • --What is ASP???? http//searchwin2000.techtarget.
    com/sDefinition/0,,sid1_gci213787,00.html
  • --VBScript
  • --OBJECTS RESPONSE WRITE
  • --Variables

2
ASP- All Inclusive Tutorial
  • General ASP Tutorial
  • http//www.aspronline.com/learn
  • An ASP Tutorial Specific to Assignments
  • http//webwizguide.com/asp/tutorials/connecting_to
    _a_database.asp

3
  • Money for ASP

4
Static Dynamic(ASP)
5
ASP
  • Server-side scripting language, lets you choose
    the syntax you wish to use for development.
  • Two most popular scripting languages for ASP are
    VBScript and Jscript
  • PerlScript is another less popular option

6
ASP
  • To set what scripting language you want to use,
    at the top of your ASP programs, you need to add
    a single line of code
  • lt_at_ LANGUAGEVBSCRIPT gt
  • VBScript is more widely used
  • JScripts syntax is much like JavaScripts.

7
ASP OBJECTSWhat is an object???
  • Response Object
  • One of the most important objects in ASP.
  • It is the object which communicates between the
    server and the output which is sent to the
    client.
  • To write an ASP page, all you need to do is write
    a standard HTML page, putting in the Active
    Server Pages script where needed.
  • Active Server Pages script is denoted by the text
    between lts and gts.

8
Response Object
  • To send ASP to the client, you need to use the
    Response Object.
  • The method of the Response Object which sends
    data to the client is the Write method.
  • Unlike an HTML page which is sent directly to the
    client, the ASP page passes through the servers
    ASP.DLL.
  • What is DLL???? http//searchwin2000.techtarget.co
    m/sDefinition/0,,sid1_gci213902,00.html

9
The Response Object
  • Example
  • lt_at_ LANGUAGEVBSCRIPT gt
  • ltHTMLgt
  • ltBODYgt
  • lt Response.Write (Hello, World!) gt
  • lt/BODYgt
  • lt/HTMLgt

10
Variables in ASP
  • All variables are of type Variant. You dont
    have to declare if your variable is an integer,
    string, or object.

lt_at_ LANGUAGEVBSCRIPT gt lt
Declare a variable. A single tick denotes a
comment in VBSscript Dim MyName
To declare a variable, you just put the
word Dim in front of the variable name. Lets
assign something to MyName MyName Scott
Mitchell
11
Variables in ASP
  • Lets create some more variables
  • Dim Age, Pi
  • Age 20
  • Pi 3.14159

Since all variables are variants, we
can Reassign values. (Bad coding,
though!) MyName 45 Pi Age Age Yellow
Schoolbus!
gt
12
Variables in ASP
  • To print out the variables, you could simply do a
    Response.Write.
  • Example
  • lt_at_ LANGUAGEVBSCRIPT gt
  • lt

Declare a variable. A single tick denotes a
comment in VBScript Dim MyName MyName Scott
Mitchell
13
Variables in ASP
  • Print out MyName
  • Response.Write (MyName)

To concatonate strings in VBScript, use
the ampersand Response.Write(My name is
MyName) gt
14
Variables in ASP
  • You can explicitly cast the type of a variable
    when you assign to it.(This is good programming
    technique)
  • Example of CStr Cint)
  • gt_at_ LANGUAGEVBSCRIPT gt
  • gt
  • Declare the variable MyName.
  • Dim MyName
  • Explicitly make MyName a string
  • MyName CStr(Scott Mitchell)

15
Variables in ASP
  • Dim Age, Pi
  • Explicitly make Age an integer
  • Age Cint (20)
  • Explicitly make Pi a floating point
  • value
  • Pi CDbl (3.14159)
  • gt

16
ADO WEB SITE
  • ADO
  • http//www.w3schools.com/ado/default.asp

17
ASP SCRIPT
lthtmlgt ltbodygt ltform action"demo_simpleform.asp"
method"post"gt Your name ltinput type"text"
name"fname" size"20"gt ltinput type"submit"
value"Submit"gt lt/formgt lt dim fname fnameRequest
.Form("fname") If fnameltgt"" Then
Response.Write("Hello " fname "!ltbr /gt")
Response.Write("How are you today?") End
If gt lt/bodygt lt/htmlgt
Write a Comment
User Comments (0)
About PowerShow.com