march 24, 2001asp review1 an asp review (of sorts)

18
March 24, 2001 ASP Review 1 An ASP Review (Of Sorts)

Upload: johnathan-lewis

Post on 31-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 1

An ASP Review (Of Sorts)

Page 2: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 2

BDPA Olympia HSCC Teams

Project A-KO

DeidraAshleyBrianErick

4 Queens and a King

JohnAlexisKarissayDemetriceShonnieka

ActivX

DarrinAlanaJustinBarretXavier

KnightRiders

NicChardonnayTierraPrestonKaylene

1) Team leader

2) Graphics designer/supplier

3) Internet resource provider

4) Forms designer

5) Database service provider

6) Tester

Roles:

Page 3: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 3

Today's Agenda

• Work on myecho.asp

• Work on project

• Play computer jeopardy

Page 4: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 4

Lab Assignment

• Modify myecho.asp

• Display date

• Echo text input

• Find a string in text input

• Test what button pushed

• Echo back a form

Page 5: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 5

Anatomy of an ASP Page

<HTML><HEAD><TITLE>My first ASP Page</TITLE></HEAD><BODY><H1>My Page Heading</H1>Hello World!<P><%VBSCRIPT COMMANDS GO HERE !%></BODY></HTML>

Page 6: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 6

Getting Stuff In and Putting Stuff Out

• Get input from your formmy_var = request.form("fieldname")

• Write HTMLresponse.write(mystring)

Page 7: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 7

Step 1: Display the Date

• Date functionsmydate = date( )

mytime = time( )

my_date_and_time = now ( )

• Your assignment– Set a variable to the date

– Display the date with a welcome message at the top of your response

Page 8: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 8

Step 2: Find a string

• Your assignment– Echo first three characters of text input– Test your text input for a string value (for example "high")– Respond with

• String not found• String found starting in this position

– Play with other string functions if you have time

• String manulation functionsfound_starting_here = instr(mystring, lookfor)

lower_case_string = lcase(mystring)

upper_case_string = ucase(mystring)

leftside = left(mystring, number_of_chars)

middle_string = mid(mystring, start_here, number_of_char)

Page 9: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 9

Conditional Flow

If condition thenstatement 1statement 2

end if

if condition thenstatement

else statement

end if

if condition thenstatement

elseif condition then statement

elsestatement

end if

If request.form("age") < 18 then response.write("You are a minor") response.write("<HR>")end if

Example

if request.form("age") < 18 thenresponse.write("You are a minor")

else response.write("You are not a minor")

end if

Example

if request.form("age") < 18 thenresponse.write("You are a minor")

elseif request.form("age") > 55 then response.write("You are a senior citizen")

elseresponse.write("You don't count!")end if

Example

Page 10: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 10

Step 3: What Button Did You Push?

• Your assignment– Indicate to user they pushed an IMAGE field– Hint:

• Image field object has "X" and "Y" property

• For example, for the IMAGE field whose name is imagefieldname:

imagefieldname.x

imagefieldname.y

• If image not pushed, value is null

• Extra credit:– Put multiple SUBMIT and IMAGE fields on your form

– Echo back which one was pushed

Page 11: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 11

Step 4: Echo Back a Form

• Your assignment– myecho.asp echo responses within a form– Put submit button on the form– Make ACTION = myecho2.asp– Have myecho2 simply respond "Hello from Echo2"

• Extra Credit– Create INPUT fields from values received from myform.html– Have Echo2 echo these values

Page 12: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 12

<FORM METHOD="POST" ACTION="myaspfile.asp">

</FORM>

The Form Tag

<INPUT …>

<SELECT …>

</SELECT>

<TEXTAREA …>

</TEXTAREA>

• Identifies the ASP file which will process it

• Used to delineate form data

Type of input fields

• You can intersperse HTML between form tags

Page 13: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 13

The <INPUT …> Tag

<INPUT TYPE="type" NAME="fieldname" VALUE="fieldvalue" … >

• Announces: "Here comes some input data"

• Describes the type of data being sent• TEXT• PASSWORD• HIDDEN• FILE• CHECKBOX

• RADIO• RESET• SUBMIT• IMAGE• BUTTON

• Identifies the fieldname and value

• TEXT attributes: SIZE="n" MAXLENGTH="n"

• Some types have special attributes

• IMAGE attribute: SRC="imagefilename"

• RADIO and CHECKBOX: CHECKED

Page 14: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 14

<SELECT …> and <TEXTAREA …> Tags

• SELECT tag provides a list of options to select from

<SELECT NAME="shirtsize" MULTIPLE SIZE=3>

</SELECT>

<OPTION VALUE="s">Small

<OPTION VALUE="l">Large<OPTION VALUE="m">Medium

• Example:

• TEXTAREA tag provides multiple line text input

<TEXTAREA NAME="mytextarea" COLS=40 ROWS=6></TEXTAREA>

• Example:

Page 15: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 15

Defining Your Application

• The purpose of your application

• The design of your application– What web pages

– How do they relate to one another

– What are their major components

– What does your form contain

– What does your database contain

Page 16: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 16

My Application Requirements

• Briefly describe your application

• Who will use my application?

• What is the purpose of this application?

• What must this application provide

• What makes it different/useful

Page 17: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 17

Application Requirements Example

The purpose of this application is to faciliate the teaching of the BDPA HSCC

My application will provide resources for future BDPA computer camps. It will provide access to class

materials and will allow students to use the site for forming teams, assigning roles with a project, and

describing their project's applications. The initial implementation will provide limited or no security. The

application will assume that students using the system to register themselves and their team will be good

citizens.

Users of my application will be HSCC instructors and students.

This application will enable easy access to teaching materials for instructors and will allow both teachers

and students to easily capture and display information about projects and teams.

This capability is not currently available so instructors can't reuse previously created materials. The

formation of teams and communication of roles is currently done in an ad-hoc manner and communicated

only on a bi-weekly basis at the camp. With this application. Student and teachers can see at any time, who

is working on what and can communicate via email addresses stored in the application's database.

A Web-Based Application for BDPA Campers and Instructors

Page 18: March 24, 2001ASP Review1 An ASP Review (Of Sorts)

March 24, 2001 ASP Review 18

Your Homework

• Project documentation - Powerpoint or Word slides containing:

– Description (requirements)

– Design

– Diagram showing Web pages

– Diagram outlining each page

– List of database fields

• Initial application web pages and database on Brinkster

– Home page

– Forms

– Other pages in your application

• Be prepared for informal review with instructors