January 27, 2001ASP Basics1 Active Server Pages (ASP) Basics The client/server model Objects Forms Active Server Pages VBScript Lab and Homework.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
1 Chapter 5 – Handling HTML Controls in Web Pages spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Chapter 31 Basic Form-Processing Techniques JavaServer Pages By Xue Bai.
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
Tutorial 6 Working with Web Forms
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
Introduction to Active Server Pages
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Chapter 9 Working with Forms. Principles of Web Design 2nd Ed. Chapter 9 2 Principles of Web Design Chapter 9 Objectives Understand how forms work Understand.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
MSSQL & ASP. Client-Server Relationship Client-Server Relationship HTML Basics HTML Basics Scripting Basics Scripting Basics Examples Examples.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Forms and Form Controls Chapter What is a Form?
Web111a_chapt06.ppt HTML: Section 6 Forms HTML tags: define data input and/or output Define the Input and/or Output on the web page Do not process the.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
Server-side Scripting Powering the webs favourite services.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Suzanne J. Sultan Javascript Lecture 2. Suzanne J. Sultan function What is a function> Types of functions:  Function with no parameters  Function with.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
March 24, 2001ASP Review1 An ASP Review (Of Sorts)
CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
IS 4506 Interactive Clients & Servers.  Overview Fat Client versus Fat Server Spectrum of Web content formats Active Server Pages Active Server Page.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Website Development with PHP and MySQL Saving Data.
HTML Forms.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
VBScript. Introduction Visual Basic scripting language is client side scripting language. It is developed by Microsoft VBScript is subset of VB language.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
7 Chapter Seven Client-side Scripts. 7 Chapter Objectives Create HTML forms Learn about client-side scripting languages Create a client-side script using.
Week 12 Working with Forms Objectives Understand how forms work Understand form syntax Create input objects Build forms within tables Build and.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event Submit comments or feedback about our site Log in to a members-only.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
Introduction To HTML Form Inputs Written By George Gimian.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP (COMPONENTS) Active Server Pages (cont..) 1. global.asa file The Global.asa file is an optional file that can contain declarations of objects, variables,
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
Week 10: HTML Forms HNDIT11062 – Web Development.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Simple PHP Web Applications Server Environment
Active Server Pages Computer Science 40S.
HTML & teh internets.
How to Write Web Forms By Mimi Opkins.
Presentation transcript:

January 27, 2001ASP Basics1 Active Server Pages (ASP) Basics The client/server model Objects Forms Active Server Pages VBScript Lab and Homework

January 27, 2001ASP Basics2 Client Server Architecture CLIENTSERVER Cook 4) Gets order from waiter 5) Gets recipe 6) Gets ingredients from refrigerator 7) Prepares food 8) Sends food to waiter Order Waiter 2) Receives order 3) Sends order to cook 9) Gets food from cook 10) Sets food on table Customer 1) Orders food 11) Eats food Food

January 27, 2001ASP Basics3 Client Server Architecture Web Server Request Response User 1) Enters a form 4) Gets request from client 5) Retrieves ASP page 6) Gets data from database 7) Creates HTML 8) Sends HTML to client 11) Reads page Brinkster.com 2) Receives user input 3) Sends HTTP message to server 9) Gets HTML from server 10) Displays page on screen Web Browser Internet Explorer CLIENT SERVER

January 27, 2001ASP Basics4 A Web-Based Application ASP Pages Web Server (Brinkster.com) Web page request Response (HTML) Web Browser (Internet Explorer) Project User Web Page Project Database Queries/Updates Data

January 27, 2001ASP Basics5 myform.html Uses tag Uses all types of input Links to myform.html myecho.asp ACTION="myecho.asp" Gets form data Redisplays data Your First ASP Application default.asp Your home page Has simple greeting Links to myform.html

January 27, 2001ASP Basics6 First - A Word About Objects An object is a named thing Has properties (attributes) that describe the object –Property is like a variable which is assigned a value –Height = 6 feet, Weight = 200 pounds Has methods –Behavior or operation - what the object do –Functions performed by the object Has collections –A collection of like things that are retrievable by name ASP objects we will be using include: –request -- the object received from the client –response -- the object sent to the client Uses “dot notation” –request.form -- the collection of fields submitted from a form –response.write -- a method which writes HTML

January 27, 2001ASP Basics7 An Object Methods Properties Collections Name:__________ Type:__________ Type: Human Name: Pat pat.haircolor pat.eat pat.genes

January 27, 2001ASP Basics8 The Form Tag Identifies the ASP file which will process it Used to delineate form data Type of input fields You can intersperse HTML between form tags

January 27, 2001ASP Basics9 The Tag 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

January 27, 2001ASP Basics10 and Tags SELECT tag provides a list of options to select from Small Large Medium Example: TEXTAREA tag provides multiple line text input Example:

January 27, 2001ASP Basics11 Example Form Using INPUT, SELECT, and TEXTAREA Tags

January 27, 2001ASP Basics12 myform.html (First Part) FORM Tag Example Examples of INPUT TYPES SUBMIT: IMAGE: BUTTON: RESET: TEXT: PASSWORD: HIDDEN:

January 27, 2001ASP Basics13 myform.html (Second Part) FILE: RADIO: Red Blue Green CHECKBOX: Rap Rock & Roll Rhythm & Blues

January 27, 2001ASP Basics14 myform.html (Third Part) Examples of SELECT and TEXTAREA SELECT: Small Medium Large TEXTAREA:

January 27, 2001ASP Basics15 Active Server Pages (ASP) Active server page is dynamic Like the cook -- depending on the order and the recipe, the ASP prepares food (HTML) ASP contains program instructions (programming language) We will use Visual Basic Script (VBscript) Vbscript must be delimited: <% your script goes here %> your script goes here

January 27, 2001ASP Basics16 Example ASP Page My first ASP Page My Page Heading Hello World! <% str = date( ) response.write("Today's date is " & str) %>

January 27, 2001ASP Basics17 Visual Basic Script (VBScript) Programming language Used in ASP pages Can also be used on client side We'll learn about: –Variable declaration –Variable types –Procedures –Built-in functions –Conditional flow (if statements) –Input/Output

January 27, 2001ASP Basics18 Variable Declaration A variable is simply a name for something A variable is assigned, a value You must define or declare a variable Declaration by use: Declare explicitly: <% dim str str = "Hello World" %>

January 27, 2001ASP Basics19 Variable Types String variables <% dim str str = "Hello World" %> Number variables <% dim temp, counter temp = 98.6 counter = 3 %> Array variables <% dim names(20), pets names(1) = John pets = array("Fluffy, "Millie, _ "Thomas") %>

January 27, 2001ASP Basics20 sub my_subroutine (myinput1, myinput2, myoutput1) statements go here end sub function my_function (myinput1, myinput2) my_function = myinput1 + myinput2 end function Subroutine Set of statements which perform a task You define your own subroutines Accept and optionally operate on parameters Function Set of statements which perform a task Many functions provided by VBScript Accept and optionally operate on parameters Returns a value Procedures

January 27, 2001ASP Basics21 Built-in Functions Math functions myinteger = int(a*b) myinteger = round(a*b) Date functions mydate = date( ) mytime = time( ) my_date_and_time = now ( ) String manulation functions found_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)

January 27, 2001ASP Basics22 Using Procedures Using a subroutine call my_subroutine (3, 5, answer) response.write(answer) Using a function if my_function(nmbr1, numbr2) > 5 then response.write("Too big") else response.write("Just right") end if

January 27, 2001ASP Basics23 Conditional Flow If condition then statement 1 statement 2 end if if condition then statement else statement end if if condition then statement elseif condition then statement else statement end if If request.form("age") < 18 then response.write("You are a minor") response.write(" ") end if Example if request.form("age") < 18 then response.write("You are a minor") else response.write("You are not a minor") end if Example if request.form("age") < 18 then response.write("You are a minor") elseif request.form("age") > 55 then response.write("You are a senior citizen") else response.write("You don't count!") end if Example

January 27, 2001ASP Basics24 Input and Output Get input from your form my_var = request.form("fieldname") Write HTML response.write(mystring)

January 27, 2001ASP Basics25 myecho.asp (First Part) Echo Form Input Echo Form Data This page echos back information submitted via the form defined on the page, myform.html. <% On Error Resume Next 'Turn on error handling str = request.form("field1") response.write(" ") response.write("Submit key field value is: " & str) response.write(" ") str1 = request.form("field2.x") str2 = request.form("field2.y") response.write("Image field value for X is: " & str1 & "and for Y is: " & str2) if str1 then response.write(" You clicked on Pat!!") end if str = request.form("field5") response.write(" ") response.write("You entered this text data: " & str & " " )

January 27, 2001ASP Basics26 myecho.asp (Second Part) str = request.form("field6") response.write(" ") response.write("My, my, here is your password for all to see: " & str) str = request.form("field7") response.write(" ") response.write("Here is my hidden field: " & str) str = request.form("field8") response.write(" ") response.write("Here is my file name: " & str) str1 = request.form("field9") response.write(" ") response.write("Here is the value returned from the radio input " & str1) str1 = request.form("field10a") response.write(" ") response.write("Here is the value returned from checkbox for rap: " & str1) str1 = request.form("field10b") response.write(" ") response.write("Here is the value returned from checkbox for rock and roll: " & str1) str1 = request.form("field10c") response.write(" ") response.write("Here is the value returned from checkbox for rhythm & blues: " & str1)

January 27, 2001ASP Basics27 myecho.asp (Third Part) str = request.form("field11") response.write(" ") response.write("Here is SELECT input: " & str) str = request.form("mytextarea") response.write(" ") response.write("Here is textarea input: " & str) %> Press here to submit more data. Press here to start over.

January 27, 2001ASP Basics28 Where Can I Get Help? Forms – ASP – – VBScript: – CSS –

January 27, 2001ASP Basics29 Your Lab Files Legend:Directory File Root myecho.asp myform.htmlhscc_labs default.asp

January 27, 2001ASP Basics30 Your Homework Assignment Expand your home page (default.asp) Update myform.html to use all form tags INPUT, SELECT, TEXTAREA All types for INPUT – TEXTRADIO – PASSWORDRESET – HIDDEN SUBMIT – FILE IMAGE – CHECKBOX B UTTON Beautify myform.html Expand myecho.asp to beautify its output