Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)

Slides:



Advertisements
Similar presentations
Client-server practices DSC340 Mike Pangburn. Agenda Overview of client-server development Editing on client (e.g., Notepad) or directly on server (e.g.,
Advertisements

Mark Dixon Page 1 16 – Passing Data between pages: Forms, Sessions, & Query Strings.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Server-Side vs. Client-Side Scripting Languages
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
Mark Dixon Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 16 – Web applications: HTML and Client-side code.
Introduction to Active Server Pages
Mark Dixon, SoCCE SOFT 131Page 1 16 – Passing Data between pages: Sessions, Query Strings, & Self Posting.
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 19 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 08 – Web applications: HTML and ActiveX controls.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: Writing data to Databases using ASP.
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Web-based Software Development - An introduction.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Mark Dixon Page 1 19 – Passing Data between pages: Forms, Sessions, & Query Strings.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
SLIR Computer Lab: Orientation and Training December 16, 1998.
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.
Introduction to Internet Programming (Web Based Application)
Copyright 2000 eMation SECURITY - Controlling Data Access with
Mark Dixon Page 1 3 – Web applications: Server-side code (JSP)
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Mark Dixon 1 22 – Web applications: Writing data to Databases using ASP.Net.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Mark Dixon 1 18 – Web applications: Server-side code (ASP.Net)
Mark Dixon Page 1 18 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 18 – Web applications: Server-side code (PhP)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
IS 4506 Interactive Clients & Servers.  Overview Fat Client versus Fat Server Spectrum of Web content formats Active Server Pages Active Server Page.
Mark Dixon 1 03 – Passing Data between pages: Forms, Sessions, & Query Strings.
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
1 Welcome to CSC 301 Web Programming Charles Frank.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 21 – Web applications: Writing data to Databases using ASP.
M Dixon 1 Web-Application Development Workshop. M Dixon 2 Session Aims & Objectives Aims –to introduce the main concepts involved in creating web-applications.
Mark Dixon 1 19 – Passing Data between pages: Forms, Sessions, & Query Strings.
RUBRIC IP1 Ruben Botero Web Design III. The different approaches to accessing data in a database through client-side scripting languages. – On the client.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Client-side & Server-side Scripting ©Richard L. Goldman August 5, 2003 Requires PowerPoint 2002 or later for full functionality.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
JavaScript and Ajax (Internet Background) Week 1 Web site:
PHP Form Processing * referenced from
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
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.
2nd year Computer Science & Engineer
Web-based Software Development - An introduction
9 – Web applications: Server-side code (ASP)
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
21 – Web applications: Server-side code (ASP)
18 – Web applications: Server-side code (PhP)
18 – Web applications: Server-side code (ASP)
Dynamic Web Page A dynamic web page is a kind of web page that has been prepared with fresh information (content and/or layout), for each individual viewing.
PHP / MySQL Introduction
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
Introduction to JavaScript
Presentation transcript:

Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)

Mark Dixon Page 2 C3 (in-class test) Results Student Number Score (max 50) Classification is for guidance only Please feel free to come and discuss your results with me

Mark Dixon Page 3 Session Aims & Objectives Aims –To introduce the fundamental ideas involved in server-side code Objectives, by end of this week’s sessions, you should be able to: –add dynamic server-side functionality, using VB Script

Mark Dixon Page 4 Example: Logon page Logon pages – probably most common page –hotmail –Amazon –University portal –utility bills (gas, electricity, phone, internet) –Travel (flights, ferry, car rental)

Mark Dixon Page 5 Example: Logon Restrict access to home page

Mark Dixon Page 6 Example: Logon - code (v1) Using Client-side VB Script: Sub btnLogon_OnClick() If txtUserName.value = "mark" And txtPassWord.value = "soft131" Then window.navigate "Home.htm" Else window.navigate "LoginFail.htm" End If End Sub Please logon: Logon.htm My Home page Welcome to my home page. Home.htm Sorry, those login details were incorrect. Please try again LoginFail.htm

Mark Dixon Page 7 Problem: View Source View Source – shows client-side script: Reveals both username & password

Mark Dixon Page 8 network connection Web Hardware and Software Client Server Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache)

Mark Dixon Page 9 Request-Response Cycle: HTML Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache) Request Mark Dixon's web site Mark Dixon's web site Welcome to my web server. Please select from the following list: Soft131: Introduction to programming for Multimedia and Internet applications. Response

Mark Dixon Page 10 Request-Response Cycle: CSC Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache) Logon.htm Request Sub btnLogon_OnClick() If txtUserName.value = "mark" And txtPassWord.value = "soft131" Then window.navigate "Home.htm" Else window.navigate "LoginFail.htm" End If End Sub Please logon: Response Client-side code: Code sent to Client Interpreted by browser

Mark Dixon Page 11 Request-Response Cycle: SSC Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache) Request Today's date The date today is 21/11/2005 The time is currently 10:28:18 Response Today's date The date today is <% Response.Write(Format(Now, "D")) %> The time is currently <% Response.Write(Format(Now, "T")) %> Server-side code: Interpreted by server (code never sent to Client)

Mark Dixon Page 12 Server-side Script (what) ASP – active server pages –executed on server takes time – request-response cycle requires server software (e.g. IIS) –code not sent to client code secure (can't be viewed by client) –results (response) sent to client pages will NOT work by double clicking on file

Mark Dixon Page 13 Server-side Script (how) ASP code: –.aspx (not.htm) –between –Response object: page sent back to client write method: adds text to response object –Now object: current date (server) Today's date The date today is <% Response.Write(Format(Now, "D")) %> The time is currently <% Response.Write(Format(Now, "T")) %> Date.aspx

Mark Dixon Page 14 Form Submission action attribute submit button Login Please login: Username: Password: Login.htm

Mark Dixon Page 15 Form Processing Login <% If Request.Form("txtUserName") = "George" Then Response.Write "Login successful." Else Response.Write( "Invalid user name.") End If %> LoginCheck.aspx

Mark Dixon Page 16 View Source Code executed at server –code is never sent to client View, Source – does not show code:

Mark Dixon Page 17 Code Execution Login <% If Request.Form("txtUserName") = "George" Then Response.Write("Login successful.") Else Response.Write("Invalid user name.") End If %> LoginCheck.aspx Server SW (IIS) Login Invalid user name. Response

Mark Dixon Page 18 Example: Logon - code (v2) Using Server-side VB Script: Please logon: Logon.htm <% If Request.Form("txtUserName") = "mark" And Request.Form("txtPassWord") = "soft131" Then Response.Redirect("home.htm") End If %> Sorry, those login details were incorrect. Please try again LoginFail.aspx My Home page Welcome to my home page. Home.htm

Mark Dixon Page 19 Running your ASP page within Visual Studio –Run (play) button (F5) –only available to you on development PC using Internet Information Services (IIS) –makes PC a server –page available to all computers on internet

Mark Dixon Page 20 IIS - Installing IIS / personal web server on Windows CD Start, Settings, Control Panel, Add/Remove Programs Add/Remove Windows Components IIS

Mark Dixon Page 21 IIS: Enabling/Disabling Start, Settings, Control Panel, Administrative Tools, Internet Services Manager Stop Start

Mark Dixon Page 22 IIS: Exposing pages Put ASP pages in: –C:\INetPub\wwwRoot (this part of hard disk exposed to outside world) Execute pages by putting: –localhost (in web browser, e.g. IE, means local machine) ASP pages don't work by double-clicking

Mark Dixon Page 23 IIS – Date.asp localhost/test/date.aspx C:\INetPub\wwwRoot\Date.aspx

Mark Dixon Page 24 Reference: Server Object Model Request object: calling web page –Form: used to get form data from previous page Response object: web page sent back –Write: used to put text into web page –Redirect: used to navigate to other page –Clear: erases all HTML in web page

Mark Dixon Page 25 Client-side vs. Server-side Code Sub btnLogon_OnClick() If txtUserName.value = "mark" And txtPassWord.value = "soft131" Then window.navigate "Home.htm" Else window.navigate "LoginFail.htm" End If End Sub Please logon: Logon.htm <% If Request.Form("txtUserName") = "mark" And Request.Form("txtPassWord") = "soft131" Then Response.Redirect("home.htm") End If %> Sorry, those login details were incorrect. Please try again LoginFail.aspx Both use VB Script language (i.e. Sub, If, Dim, For, etc.) Objects are different

Mark Dixon Page 26 Tutorial Exercise: Login Task 1: Get the Login (v2) example from the lecture working. Task 2: Copy your web site to C:\INetPub\wwwroot and access it via localhost Task 3: Try accessing other peoples pages Note: the domain names of the lab PCs are their serial numbers (written on the side of the base unit - TO???????)

Mark Dixon Page 27 Tutorial Exercise: Multiply Task 1: Create a new web site, that multiplies two numbers entered into text boxes by the user.