California 4-H Youth Development Program Identity Mark   "The University of California 4-H Youth Development Program
Engages Youth in Reaching Their Fullest Potential while
Advancing the Field of Youth Development."
University of California Logo  
         
 
4-H Mall: Shop 4-H
 

Server Side Scripting with ASP

a part of the CA 4-H Computer Corps Workshop Series

Originally created by Steven, 2002
Revised by Steven, 2006

Goals

  • Become aware of server-side scripting, its uses and various languages available (ASP, PHP, JSP, ColdFusion)
  • Learn the basics of the Microsoft Active Server Pages (ASP) script using Visual BASIC
  • Introduce the potentials for database connections

Description

Learn Interactive Webpage design using ASP, Microsoft's Server-Side Scripting language. Add flexibility and interactivity to your webpages! Interact with a database, displaying information from SQL queries, entering data, and making your website truly dynamic. ASP allows incredible control over webpages. This workshop will begin with a basic overview of Server-Side Scripting, following by more advanced control statements using VBScript, interacting with Access Database, and introducing other features of ASP.


Lesson Plan

  • Workshop prerequisites
    • Knowledge of HTML
    • Awareness of Access
    • Awareness of FrontPage
  • Agenda
    • Introductions
    • Example of dynamic web system
    • What is Server-Side Scripting?
    • What languages are available?
    • ASP
      • Text, math, If, Loops, Forms, QueryString, DB
    • Practice Time!
  • Introductions
    • Name
    • State
    • Experience with Webpages
    • Favorite cracker
  • Server-Side vs. Client Side
    • Executed by the server and a HTML page is sent to the server.
    • Downloaded and executed by the browser
  • Examples of Server-Side Scripting
  • Server-Side Scripting
    • Advantages
      • Allows creation of dynamic web pages
      • Modifies HTML code on the server before sent to client
      • Uses databases such as Access and Oracle
      • Responds to user input
    • Disadvantages
      • More complicated then HTML (with debugging)
      • Slower to load on the server
      • Harder to learn
      • Web server must be enabled
  • Server-Side Scripting Process
  • Types of Languages
    • ASP and ASP.NET (Microsoft)
    • JSP (Sun Microsystems)
    • ColdFusion (Macromedia)
    • Perl (open-source)
    • PHP (open-source)
  • Criteria Affecting Decisions
    • Web server availability
    • Knowledge of language
    • Scalability and efficiency
    • Personal preference
  • ASP - Active Server Pages
    • Use Visual Basic to program
    • Use of COM objects (I.e. libraries)
    • Integrated with Windows and IIS
  • JSP - Java Server Pages
    • Uses java
  • ColdFusion
    • Uses HTML tag-like code
    • Simple and easy
    • Has proprietary editor
    • Uses own web server software
  • Perl
    • Used often for web programming
      • Especially with Apache web server
    • Open-source
  • PHP - Personal Home Page
    • Open source and free!
    • Easy to learn
    • Used by www.4-h.org
  • Open Practice Web
    1. Open Microsoft FrontPage
    2. "Open Web"
    3. Create a folder for yourself
    4. Create a file
  • Now for ASP!
    • Can change the content of pages dynamically!
    • Uses Visual Basic (or JavaScript)
    • ASP code is placed within blocks on pages
    • Comments are preceded by ' in code
    • Files have a .asp extension
    • Note: Using ASP, not ASP.NET
  • Example HTML Page
  • Adding Text to Pages
  • Advanced Text
  • PRACTICE
    • Output text/dates on your test page
  • Math!
  • PRACTICE
    • Output math calculations
  • If Statements
  • Loops
  • PRACTICE
    • Add an if statement to your webpage
    • Add a loop to your webpage
  • Forms!
    • HTML Forms are used to gather data
  • Use the data!
    • <%=Request.Form("steven")%>
    • Put data into variables
    • Use in loops or if statements
    • Respond to user
  • PRACTICE
    • Make a page with a form
    • Make a page to output the form data onto the screen
  • Query String
  • Session Variables
    • Keep information for the entire "session" a user is in a series of pages
    • <%Session("var") = xxxxx%>
  • Other Packages
    • Ad Rotator
    • Contact Rotator
    • Send Email
    • Application variables
  • PRACTICE
    • How could you "authenticate" (validate) a user before they can view a webpage on your site?
  • Databases
    • ADO provides easy connection with databases
    • Step 1: Setup database connection
    • Step 2: Create SQL query
    • Step 3: Open database
    • Step 4: Use the data!
  • SQL - Structured Query Language
    • Method for querying databases
    • Uses specific keywords
    • Easiest to design in Access and cut & paste SQL code
    • SELECT * FROM table WHERE ID=3;
  • ASP code for databases
  • Using ASP databases
  • Wrap up/ Question and Answer

Materials

  • Server Side Scripting (PPT)
  • Handouts to include:
    • ASP Overview (Word)
    • ASP-Database Overview (Word)

Requirements

Projector, screen, laptop
Web access
For participant practice: server access


Resources on the Web


Return to the CA 4-H Computer Corps Workshop Series

     

University of California Seal   University of California: Agriculture & Natural Resources

Website maintained by the California 4-H Computer Corps
(The Official California State 4-H Youth Development Program Website)

Copyright © 2008 The Regents of the University of California. 
The 4-H Youth Development Program name and emblem
are service marks protected under 18 U.S.C. 707.
Non-Discrimination Statement