BA394 VBScript Lecture 2 - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

BA394 VBScript Lecture 2

Description:

... ifs work JUST like a normal If statement, however you have to be MUCH more careful. ... A Submit Button (Form Object) A active database connection (ADO Connection) ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 12
Provided by: busine
Category:

less

Transcript and Presenter's Notes

Title: BA394 VBScript Lecture 2


1
BA394 VBScript Lecture 2
  • DeVaris Brown

2
In this Lecture
  • Quick overview on various Control Statements.
  • We will learn more about Nested Loops.
  • A brief introduction to Form objects.
  • And finally look at a working Login page.

3
Control Statements A Brief History
  • Control statements are used to let your program
    decide where it wants to go next.
  • Probably the most classic example of a control
    statement is the If Statement.
  • Before the If statement was created however, the
    very first form of a control statement was the
    GoTo command.

4
Control Statements (II)
  • The format of the if statement is as follows.
  • If ltexpressiongt Then
  • Do Something
  • Else
  • Do Something else
  • End If

5
Nested Ifs (Ifs in Ifs)
  • Nested ifs work JUST like a normal If statement,
    however you have to be MUCH more careful.
  • Nested ifs are really just an If statement inside
    of an If statement. They are often hard to read
    / understand.
  • Useful when you have to evaluate multiple things
    at the same time.
  • See Nested If example on the web

6
Case Statement (A Better If)
  • Case statements were created to give the
    programmer a cleaner / quicker way to evaluate
    many conditions at the same time.
  • The syntax is as follows
  • Select Case ltvariablegt
  • Case ltexpressiongt
  • Case ltexpressiongt
  • Case Else
  • End Select
  • See Case Statement example on the web.

7
A Form Objects Primer
  • Form objects are probably the most important
    method of ASP. They provide an easy way to
    transfer data from the user to the system.
  • A Form object can come in many Forms one of
    which is the Command Button, another would be a
    Text Input Box.
  • When a user enters in their name in a text box
    and hits submit, this is an example of ASP Form
    Objects.

8
Login.asp What needs to happen
  • Today, everyone will be creating a login.asp page
    for use with their projects.
  • The login.asp will allow a user to enter in their
    username (Email address) and password.
  • Once this information is submitted, the server
    will look in the database and tell then wither or
    not they are allowed to login (Authenticated).

9
Login.asp The Code
  • The main objects that you will need to complete
    this are
  • Two Text boxes (Form Objects)
  • A Submit Button (Form Object)
  • A active database connection (ADO Connection)
  • You can see an example of what I did for a simple
    login page online (NOT what you are supposed to
    do).

10
Questions or Comments
11
Final Notes
  • Be sure that everyone in the group knows how to
    create the login page for this project.
  • Also make SURE you check back on the website
    before the quiz next week as there may be changes
    noted etc..
  • Finally if you have any other questions or
    problems dont hesitate to email me.
    (dpbrown_at_uiuc.edu)
Write a Comment
User Comments (0)
About PowerShow.com