Server Side Programming ASP1 Server Side Programming.

Slides:



Advertisements
Similar presentations
DT228/3 Web Development WWW and Client server model.
Advertisements

Session 13 Active Server Pages (ASP) Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Languages for Dynamic Web Documents
IIS Technologies.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Server Side Programming ASP1 Server Side Programming Database Integration Peter O’Grady.
1 Chapter 12 Working With Access 2000 on the Internet.
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
ISYS 546 Client/Server Database Application Development.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Introduction to Web Database Processing
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
An Overview of Database Access on the Web An Overview of Database Access on the Web Using ASP and Microsoft Database Technology Sheffield Hallam University.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
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.
4/8/99 C. Edward Chow Page 1 Active Server Page It is a server-side scripting environment for creating dynamic content. ASP are files with.asp extension,
Introduction to Web Interface Technology (CSE2030)
4/8/99 C. Edward Chow Page 1 Internet Services Manager Click Start | Programs | Administrative Tools | Internet Services Manager.
Introduction to Web Interface Technology (CSE2030)
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Web-based Software Development - An introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Data-Enabled Web Sites: Classibooks.com & Internet Database Technologies Colin Fukai April 4, 2000 Gonzaga University.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Server Side Programming ASP1 Server Side Programming Database Integration (cont.) Internet Systems Design.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Fundamentals of Database Chapter 7 Database Technologies.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Web Design and Development for E-Business By Jensen J. Zhao Copyright 2003 Prentice Hall, Inc. Web Design and Development for E-Business Jensen J. Zhao.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Active Server Pages Server-Side Scripting and Client-Side Scripting.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
Database Connectivity and Server-Side Scripting Chapter 12.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Server Side Programming Database Integration
PHP / MySQL Introduction
Web Development Using ASP .NET
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Presentation transcript:

Server Side Programming ASP1 Server Side Programming

Server Side Programming ASP2 Content n Introduction n Server Side Programming (ASP) n ASP Architecture n Programming Techniques n Sample Examples

Server Side Programming ASP3 Introduction n Internet allows for client-server systems n Programs can be invoked on either/both clients and servers: –Client side includes Java Applets, ActiveX components with JScript or VBScript. –Server side includes CGI and ASP n Data can be kept on servers distributed across network and accessed via client

Server Side Programming ASP4 Why use Internet to access data? n People can access the data using a familiar browser interface. No special software required. n Data can be maintained centrally or distributed. n Data can be integrated with other information in an institution’s web pages n Information can be made available to anyone (with permission) on the Internet

Server Side Programming ASP5 How can database be accessed by web browser? Web browser Server Side Programming e.g. Microsoft IIS server : ASP (VBScript, JScript, SQL) Internet Database

Server Side Programming ASP6 Client Side Scripts n They are browser-specific, so the same code may be interpreted differently depending on the browser being used. n They can't be used to refer to a database n They can lessen the burden on server n Particularly useful for validating data before sending to server side to be processed.

Server Side Programming ASP7 Server Side Programming (ASP)

Server Side Programming ASP8 Content n Server Side programming overview n Example –Microsoft Internet Information Services (IIS) –Active Server Page(ASP) –VBScript/JScript

Server Side Programming ASP9 Common Gateway Interface (CGI) n CGI Is a standard for interfacing external applications with web servers (Common Gateway Interface, 1995). n Involves a new process each time it is invoked therefore can be slow with multiple users. n Alternatives: ISAPI (ASP), NSAPI.

Server Side Programming ASP10 IIS n IIS is a web server that runs on Win NT, 2000, Server2003 and XP Server. n Can use component-based (COM/ActiveX) client/server applications as well as JScript (ECMAScript) and VBScript

Server Side Programming ASP11 What is ASP? “A server - side scripting environment that you can use to create and run dynamic, interactive, high - performance Web server applications”. Microsoft Can include COM/ActiveX components and/or compiled code Runs on IIS

Server Side Programming ASP12 What are Active Server Pages? n Server-side environment n Can provide compile-free application environment n Combine HTML, scripts, COM and ActiveX server components. n Uses Server and Client Information to create and send dynamic web pages to clients

Active Server Pages n Is program that runs inside IIS n IIS-Internet Information Services n As free software component with windows 2000 n Option pack can be downloaded from Microsoft Server Side Programming ASP13

Server Side Programming ASP14 Using ASP n User usually completes HTML form in a browser and submits this to a.asp file on the server (note that you need a.asp file on the server) n.asp file contains both HTML and scripts/components n Scripts/components invoked and produce new HTML code n resulting page: original HTML + new HTML (generated by asp) - this is sent to client.

Server Side Programming ASP15 Using ASP n Server evaluates tag starting with n Scripts/components contained within tags n Web servers supporting ASP: –Personal Web Server (Windows 95, 98, NT) –Internet Information Services (Windows NT Server, 2000 Server, Server 2003, XP)

Server Side Programming ASP16 ASP Basics n ASP file is a text file with the extension.asp n it contains any combination of: –Text –HTML Tags –ASP Script Commands/Components

Server Side Programming ASP17 Client-Server Structure IIS Client request Running ASP Script... results

ASP Architecture n Is microsoft technology for sending client dynamic web content including XHTML,Dynamic HTML,ActiveXControls,Client Side Scripts and Java Applets n ASP Processes the request and sends response to client n When client request ASP,its loaded into memory and parsed by scripting engine named ASP.DLL Server Side Programming ASP18

Server Side Programming ASP19 ASP Script n ASP Script could be VBScript or Jscript n A script is a series of commands or instructions. n Script command instructs the web server to perform an action. n VBScript is similar to Visual Basic and Visual Basic for Application (VBA).

Server Side Programming ASP20 VBScript Basics n Not case sensitive n Declaring Variables n VBScript does not require variable declarations, but it is good scripting practice to declare all variables before using them. n To declare a variable in VBScript, use the Dim, Public, or Private statement.

Server Side Programming ASP21 Declaring Variables Dim: Declares variables and allocates storage space. Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure. Ex. Dim A,B Private: Used at script level to declare private variables and allocate storage space. Private variables are available only to the script in which they are declared Public: Used at script level to declare public variables and allocate storage space. Variables declared using the Public statement are available to all procedures in all scripts in all projects.

Server Side Programming ASP22 VBScript Basics n VBScript Operators: –Arithmetic: +, -, *, /, ^ –Comparison: =, <>,, = –Logical (for Boolean variables): Not, And, Or, Xor

Server Side Programming ASP23 VBScript Basics n Conditional Statement: –IF … Then… Else If condition Then [Statement] elseif condition-n Then [elseifstatment]… else [elsestatements] End if

Server Side Programming ASP24 VBScript Basics n Loop: –Do … Loop –While …Wend –For … Next –For Each …Next n Procedures: –Sub –Function

Server Side Programming ASP25 ASP Demo n ASP uses to enclose script commands. ASP Example 1 This page was last refreshed on Now it is Note 1: The VBScript function Now returns the current time, Date returns current date. Note 2: No data is input by the user

ASP Demo n The response.write command is used to write output to browser n Exp <% Response.write(“Hello World”) %> Server Side Programming ASP26

Including Javascript <% Response.write(“Hello World”) %> Server Side Programming ASP27

Global.asa File n Contains Application Events n Session Events n Declarations n TypeLibrary Declarations n The #include directives n Note –Global File.asa must stored in root directory of ASP application, and each application can only contain only one Global.asa file Server Side Programming ASP28

Server Side Programming ASP29 Running ASP n Save file with.asp extension on server n Client accesses the file in similar fashion to.htm (or.html) file n Server detects.asp extension and runs script within ASP tags n Results sent to client

Server Side Programming ASP30 Example 2 ASP Example 2 A= B=

Server Side Programming ASP31 Example 2 see web site Contained in HTML code: <% dim A, B A=Request.form("ValueofA") B=Request.form("ValueofB") %> ………. A+B= A-B= A*B= …….

Server Side Programming ASP32 example 2 asp Example 2 ASP Page Example Page A+B= A-B= A*B=

Server Side Programming ASP33 Database Overview

Server Side Programming ASP34 What is a Database? n A database is an organized collection of related data, typically stored on disk, and accessible by possibly many concurrent users. n Most common is relational database, which is a tabular database in which the data is defined so that it can reorganized and accessed in a number of different ways

Server Side Programming ASP35 Database Management Systems n DBMS n A program to access, manipulate and present the data to a user. n Example DBMS: –Oracle –Sybase (Microsoft SQL) –IBM’s DB2, IMS and SQL/DS –dBase –Access

Server Side Programming ASP36 Relational Database Structure n set of tables containing data fitted into predefined categories. n each table(relation) contains one or more data categories in columns. n each row contains a unique instance of data for the categories defined by column.

Server Side Programming ASP37 Example: Access n Relational database n Fairly good GUI. n Can use SQL

Server Side Programming ASP38 Relationships in Access n Multiple tables in one database n Matching key fields between table –A key is usually a field with the same name in both tables. –Such key is primary key for one table, foreign key in the other table.

Server Side Programming ASP39 SQL n SQL: Structured Query Language n It is used to query from and update database. n Systems using SQL: Oracle Sybase Microsoft SQL server Access

Server Side Programming ASP40 SQL n Standard SQL commands: –Select –Insert –Update –Delete –Create

Server Side Programming ASP41 SQL Example database - example3.mdb tablename - table1 columnname - ID, ItemName, Price

Server Side Programming ASP42 SQL Example n To find out the ‘Price’ when ‘ItemName’ equals to Candy SELECT Price FROM Table1 WHERE ItemName = ‘Candy’ Note: Can SELECT * to return whole row as an object - see Example 3 on website

Server Side Programming ASP43 SQL Basic n Insert tablename (fieldname1, fieldname2…) values (value1, value2) n update tablename set column_name1=expression1

Server Side Programming ASP44 SQL Basic n Create tablename (fieldname1 type, fieldname2 type) n Delete [*] from tablename where clause (deletes whole row)

Server Side Programming ASP45 Database Integration Requirements n Server (IIS) n Database Internet database connector (ODBC) not always required can use ADODB n Dynamic Web Page (asp) User Input using HTML forms Data Transmission Retrieving data from database Display results

Server Side Programming ASP46 Operation database Server Client HTML ASP

Server Side Programming ASP47 Using web browser to access a database n Web pages and forms are used to provide access to the database. n Database can be queried or updated. n Platform-independent front-end. n Database vendor-independent front-end n Client machine does not need database networking software

Server Side Programming ASP48 Example Implementation n Step 1: HTML file (containing forms) for user input on server. n Step 2: Database on server n Step 3: Setup database connection (ODBC)

Server Side Programming ASP49 Step I: HTML File with Forms n Example: Gum Suckers Taffy Skittles M&Ms Lifesavers Snickers This captures user input and sends result to result.asp

Server Side Programming ASP50

Server Side Programming ASP51 HTML Forms Example

Server Side Programming ASP52 Step II: Database n Under the home directory, create the access database named “Candy.mdb” n tablename - Products n columnname - ID, ItemName, Price

Server Side Programming ASP53 <% dim price Set MyConn = Server.CreateObject("ADODB.Connection") set rs = Server.CreateObject("ADODB.Recordset") MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("Candy.mdb") item = Request.form("item") Set RS = MyConn.execute("Select * from Products where Candy = '" & item & "'") if rs.Eof then Price = "" else Price = RS("Price") End if Response.Write("It will cost you $" & price) Set MyConn = nothing Set rs = nothing %>

Server Side Programming ASP54 Running ASP n Check the extension (asp) n server evaluates tag starting with n server replaces the tags with normal HTML using scripts n results page: original Markup + new Markup(generated by asp)

Server Side Programming ASP55 Result

Server Side Programming ASP56 Java2 Enterprise Edition EJBs (Enterprise JavaBeans) ----picture PCWeek