1.264 Lecture 19 Web database: Forms and controls



Similar documents
Tutorial #1: Getting Started with ASP.NET

IP Phone Services Configuration

Visual COBOL ASP.NET Shopping Cart Demonstration

2. Modify default.aspx and about.aspx. Add some information about the web site.

Publishing Your Website Using MS-FTP (for Windows Users)

How to test and debug an ASP.NET application

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

Expanded contents. Section 1. Chapter 2. The essence off ASP.NET web programming. An introduction to ASP.NET web programming

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Installing and Configuring Microsoft Dynamics Outlook Plugin to Use with ipipeline MS CRM

SecureAssess Local. Install Guide. Release 9.0

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

How to use FTP Commander

owncloud Configuration and Usage Guide

User Guide. Version 3.2. Copyright Snow Software AB. All rights reserved.

Please note that a username and password will be made available upon request. These are necessary to transfer files.

Using SSH Secure FTP Client INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 2.0 Fall 2008.

Using Internet or Windows Explorer to Upload Your Site

Welcome to Collage (Draft v0.1)

Outlook Web App User Guide

Site Maintenance Using Dreamweaver

Microsoft FrontPage 2003

Documentum Content Distribution Services TM Administration Guide

Web Content Management Training Manualv3

Basic Web Fullerton College

GoDaddy (CentriqHosting): Data driven Web Application Deployment

WEBTrader. User Guide

The Web Pro Miami, Inc. 615 Santander Ave, Unit C Coral Gables, FL T: info@thewebpro.com

Colligo Manager 5.1. User Guide

Web Design. Links and Navigation

MultiSite Manager. User Guide

Colligo Manager 6.0. Offline Mode - User Guide

Installing SQL Express. For CribMaster 9.2 and Later

Colligo Manager 6.0. Connected Mode - User Guide

WS_FTP Pro for Windows 95/98/NT

WSDOT ProjectWise V8i Training 101

Hands-On Lab. Web Development in Visual Studio Lab version: Last updated: 12/10/2010. Page 1

VP-ASP Shopping Cart Quick Start (Free Version) Guide Version 6.50 March

SQL Server Database Web Applications

E--Mail Archive Mail Ar User G u d ide

TAMUS Terminal Server Setup BPP SQL/Alva

Item Audit Log 2.0 User Guide

Air Resources Board File Transfer Protocol (FTP)

Internet Explorer Browser Clean-up

wce Outlook Contact Manager Documentation

INFOPATH FORMS FOR OUTLOOK, SHAREPOINT, OR THE WEB

Build an ArcGIS Online Application

Getting Started with Tableau Server 6.1

Table of Contents. Welcome Login Password Assistance Self Registration Secure Mail Compose Drafts...

ORACLE BUSINESS INTELLIGENCE WORKSHOP

USER GUIDE WEB-BASED SYSTEM CONTROL APPLICATION. August 2014 Phone: Publication: , Rev. C

Previewing & Publishing

Using Outlook Web Access

The LSUHSC N.O. Archive

Taleo Enterprise. Taleo Reporting Getting Started with Business Objects XI3.1 - User Guide

Intermediate ASP.NET Web Development with C# Instructor: Frank Stepanski. Data Sources on the Web

The software shall provide the necessary tools to allow a user to create a Dashboard based on the queries created.

Voice-Over PowerPoint (VOPP) and FTP Instructions for Online Courses (for Windows PC Computers) December 2009

WebSpy Vantage Ultimate 2.2 Web Module Administrators Guide

ConvincingMail.com Marketing Solution Manual. Contents

MadCap Software. Upgrading Guide. Pulse

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

Using Remote Web Workplace Version 1.01

Perceptive Intelligent Capture Solution Configration Manager

Visual Studio.NET Database Projects

QuickNotes for using Tumbleweed, ISO's FTP system.

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

DocuSign for SharePoint

Query JD Edwards EnterpriseOne Customer Credit using Oracle BPEL Process Manager

Business Portal for Microsoft Dynamics GP User s Guide Release 5.1

THE CHILDREN S HEALTH NETWORK CONTRACTING TOOL TRAINING MANUAL

Appendix A How to create a data-sharing lab

Version USER GUIDE

MySQL Quick Start Guide

MOVING THE SENIOR DEVELOPMENT CLASS FROM WEB DEVELOPMENT TO LIFE CYCLE DEVELOPMENT A CASE FOR VISUAL STUDIO 2005

SelectSurvey.NET Developers Manual

Jim2 ebusiness Framework Installation Notes

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

WinSCP for Windows: Using SFTP to upload files to a server

Does the GC have an online document management solution?

ACTIVE DIRECTORY WEB SERVICE USER GUIDE LAST UPDATED: January 4, 2013

Lab 1: Create a Web Site

Installing and Configuring Login PI

Creating a Website with Publisher 2013

Crystal Reports Installation Guide

Installation of MSSQL Server 2005 Express Edition and Q-Monitor 3.x.x

Before you may use any database in Limnor, you need to create a database connection for it. Select Project menu, select Databases:

BID2WIN Workshop. Advanced Report Writing

Excel What you will do:

VP-ASP Shopping Cart QUICK START GUIDE Version th Feb 2010 Rocksalt International Pty Ltd

Millennium Drive. Installation Guide

FieldIT Limited FieldIT CRM. Installation Manual v1.3.i3 (Enterprise Install)

HDAccess Administrators User Manual. Help Desk Authority 9.0

Use ArcGIS Online to Manage

DSI File Server Client Documentation

FORM SIMPLICITY QUICK REFERENCE GUIDE PROFESSIONAL/ULTIMATE EDITION

Password Memory 6 User s Guide

Dreamweaver Tutorial #1

Outlook Web Access (OWA) User Guide

Transcription:

1.264 Lecture 19 Web database: Forms and controls We continue using Web site Lecture18 in this lecture Next class: ASP.NET book, chapters 11-12. Exercises due after class 1

Forms Web server and its pages are a communications channel between databases We first create communications between a user and a database by using forms More visible and intuitive, use the same principles Based on XHTML pages and HTTP Database-database communications will be covered next Based on XML and HTTP, packaged in Web services Machine-readable, can be validated by machines Some human review is still used because there isn t complete trust among trading partners, engineering collaborators, etc. Machine-machine communications create SQL database queries to fill in XML forms and send them to the database 2

How XHTML forms transmit data Forms allow a series of controls to be placed on the page Controls are text boxes, dropdowns, radio buttons, check boxes Each control has a name and a value Form data is sent when user presses Submit button. Options: Data is sent to URL with HTTP POST command as string of form: Name1=Value1&Name2=Value2& NameN=ValueN POST data is string sent after blank line after HTTP headers Data is sent to URL with HTTP GET command, appended to end of GET string after a?: GET/Index.html?Name1=Value1&Name2=Value2& Data is sent to Web services POST followed by an XML document We cover XML later: it allows validation and business rules Form s Submit button is associated with the URL of an application server method that will process the input data Server programs have methods (function points) to extract the data from the POST or GET command and use it in the program We counted Web pages and estimated function points earlier 3

Browser-server forms interaction Step 1: Browser requests form without any parameters Step 2: Server fetches and returns input form Step 3: User fills out or edits input form and presses submit button Step 4: Browser packages form into query string and sends to server Step 5: Program synthesizes a response document and returns it Client Side GET /App/Page.htm xxxxxx xxxxxx POST /App/Prog.htm name=pat&state=ma Server Side Web svr Web svr MyProg MyProg Forms also support dynamic controls on an xhtml (aspx) page, such as.net s SqlDataSource, GridView, etc. In.NET, all pages that return dynamic results are.aspx pages and are forms 4

Example XHTML input form <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form action="inputform.aspx" method="post"> Last name: <input type="text" name="lname" /> First name: <input type="text" name="fname" /> <input type="submit" value="submit" /> </form> </body> </html> Mozilla. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. 5

Review: Set SQL Server database access Create login for SQL Server in SSMS if you haven t: In Object Explorer, open Security-> Logins Right click, select New login Select SQL Server authorization; enter name, password Select default database= MIT1264 Check all server roles, check user mapping for MIT1264 6

Review: Create Web site, database connection In VSW, use Lecture 18 site from last class Delete Default.aspx, Site.master. We ll replace them. Download Lecture18 zip file if you didn t already Unzip it in a temporary directory and then move its files to the Lecture18 Web site at C:\Inetpub\wwwroot\Lecture18 MIT.master has common graphics for each page and a placeholder for active content Images folder contains graphics used in MIT.master Web.sitemap contains navigation structure of your site Refresh the solution explorer after moving files into site Tools-> Connect to Database Server:.\SQLEXPRESS or SQLEXPRESS Login name and password you set up earlier Database name: MIT1264 Test the connection Look at database in Database Explorer in VWD 7

Review: Create XHTML form (.aspx page) View->Toolbox To make toolbox appear along left margin of page File-> New File-> Web Form: Orders.aspx Check master page and select MIT.master Uncheck code in separate file In Design view, from the Toolbox Drag a SqlDataSource control into the ContentPlaceHolder Click the arrow at its top right, then on configure source Select connection you already created Select Orders table Check * to get all columns, ORDER BY Cust Test query and finish Drag a GridView control on top of the SqlDataSource Choose data source Check enable sorting and enable paging Add header 2 <h2> with Orders. Save the page Use the browser symbol on the toolbar to test the page 8

Exercise 1: XHTML Customers page Create a Web page to display the Customers table: Customers.aspx. Same steps as before. Use MIT.master for its appearance Enable sorting and paging Create Default.aspx with new XHTML that uses MIT.master Keep the name Default.aspx Place short text in the ContentPlaceHolder on the page Change links in MIT.master to point to your Orders, Customers pages, not Default When done, test with the browser Start at Default.aspx Navigate to Orders and Customers and then back to Default In browser, View Source to see what XHTML has been generated 9

Solution 1 10

Exercise 2: Display, edit and delete data File -> New File-> Web Form: Customers2 Drag SqlDataSource into ContentPlaceHolder SELECT * FROM Customers ORDER BY Company Click Advanced and generate edit, update, delete SQL Test and save Drag GridView onto SqlDataSource Set data source Enable paging, sorting, edit, delete Put a header <h2> at the top of the ContentPlaceHolder: Customers Save and test: edit, delete Can t delete a customer if they have an order Insert not present in GridView 11

Solution 2 12

Exercise 3: Display, edit, insert, delete data File -> New File-> Web Form: SalesReps Drag SqlDataSource into ContentPlaceHolder SELECT * FROM SalesReps ORDER BY Name Drag GridView onto SqlDataSource Enable paging, sorting, selection Drag a second SqlDataSource into ContentPlaceHolder, below the first one SELECT * FROM SalesReps WHERE Click WHERE button: RepNbr, =, Control, GridView1, Add Click Advanced button: Generate INSERT,UPDATE,DELETE Drag FormView control onto 2 nd SqlDataSource Choose second SqlDataSource as data source Add <h2>, save, and test in browser 13

Exercise 3, cont: Display, edit, insert, delete GridView doesn t update when you change data. To make it do so: In Design view, click on FormView Click Events button (lightning bolt) in Properties window Double-click ItemInserted event Add following code GridView1.DataBind(); Then double-click ItemDeleted event and add same code And double-click ItemUpdated event and add same code Save and test your page Add Title at top of all the pages you created 14

Solution 3 15

Data transmittal across Web These pages request a response from the server Your Web browser sends an HTTP POST request to the Web server URL is, e.g., localhost/customers.aspx.aspx page is a program that dynamically generates the response xhtml (or XML) page In your browser: Right click, select View Source on result page It is an xhtml page; the logic on the.aspx page has been executed and the response returned to your browser Note that we are dragging and dropping controls, without doing any programming This will probably become the standard way to build business systems: it can be done by analysts, not IT Specialized controls for supply chain, etc. 16

HTTP and XHTML HTTP Is only direct form of interaction between browser and server Was an extremely perceptive extension of email, ftp protocols by Tim Berners-Lee to enable Web browsers Request-response paradigm Connection made for each request/response pair Core Web protocol, very stable XHTML Page definition language, based on tags High level page description, not specific formatting Forms used to enter and submit data to Web server, and to invoke dynamic Web pages on Web server 17

MIT OpenCourseWare http://ocw.mit.edu 1.264J / ESD.264J Database, Internet, and Systems Integration Technologies Fall 2013 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.