McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.

Slides:



Advertisements
Similar presentations
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?
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web App Development with ASP.NET. Introduction In this chapter, we introduce web-app development with Microsoft’s ASP.NET technology. Web-based apps create.
1 Chapter 12 Working With Access 2000 on the Internet.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Integrating Access with the Web and with Other Programs.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Web-Based Applications
Introduction to Web Interface Technology (CSE2030)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
INTRODUCTION TO WEB DATABASE PROGRAMMING
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 9 Web Applications.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
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.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
1 Welcome to CSC 301 Web Programming Charles Frank.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
Week Developing Web Applications 12. Programming for the Web A Web Application Runs on a Web Server and Presents Its Content to the User Across a Network,
Chapter 1 Getting Started With Dreamweaver. Exploring the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 9 Web Applications.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
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.
Web Forms, HTML, and ASP.NET
Web Development in Microsoft Visual Studio 2013
Chapter 9 Programming with Web Forms
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-2 Objectives Explain the functions of the server and the client in Web programming. Create a Web Form and run it in a browser. Describe the differences among the various types of Web controls and the relationship of Web controls to controls used on Windows forms. Understand the event structure required for Web programs. Design a Web Form using tables. Validate Web input using the validator controls. Define ASP, XML, WSDL, and SOAP.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-3 Visual Basic and Web Programming In VB.NET, Web Forms are used to create the user interface for Web projects. Web Forms display as a document in a browser. Create documents that display on mobile devices such as cell phones and personal digital assistants (PDAs).

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-4 Client/Server Web Applications Require a server and a client –Server sends the Web Pages to the Client. –Client displays the Web Pages in Browser.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-5 Web Servers To develop Web applications use either a Remote Web Server --OR-- Local machine set up as a Web Server by installing IIS before installing VB

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-6 Web Clients Browsers display pages written in hypertext markup language (HTML). Microsoft Internet Explorer Netscape Pages may also contain program logic in the form of Java Applets Script – JavaScript – VBScript – JScript

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-7 Web Pages Stateless Does not store any information about its contents from one invocation to the next Techniques for working around Stateless Cookies stored on local machine Sending state information to server as part of the page's address, uniform resource locator (URL)

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-8 ASP.NET ASP.NET 3.5 is the latest Web programming technology from Microsoft. ASP.NET provides libraries, controls, and programming support for programs that: Interact with the user Maintain state, render controls Display data, and generate appropriate HTML When using Web Forms in VB.NET you are using ASP.NET. Object-oriented event-driven Web applications can be created using VB and ASP.NET.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved. 9-9 Visual Basic and ASP.NET Each Web Form has two distinct pieces HTML and instructions needed to render the page VB code Web Form generates a file with an.aspx extension for HTML and.aspx.vb extension for the VB code. Visual Studio IDE automatically generates the HTML. HTML tags can be viewed and modified in the Visual Studio editor. VB code contains the program logic to respond to events called the “code-behind” file. VB code is not compiled into an.exe file as it is for Windows applications.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Types of Web Sites Web applications are referred to as Web sites in VS There are four types of Web sites File System Web sites IIS Web sites FTP sites Remote sites

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Creating a Web Site (1 of 2) Select New Web Site from the File menu — in the New Web Site dialog box, selections can be made for template, location, and language. A new Web site automatically contains one Web page called Default.aspx. A second file, Default.aspx.vb, the code- behind file, holds the VB code for the project.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Creating a Web Site (2 of 2) Begin a new Web project by entering the location and project name on the New Web Site dialog box.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Web Forms in the Visual Studio IDE As Web project opens, connection to Web Server is established. Web Forms are based on a completely different class. Web Forms have different Controls Properties, Methods, and Events Toolbar, Toolbox, and lists of files in Solution Explorer

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Visual Web Developer with New Web Site

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Viewing the HTML Code Design and Sources tabs at bottom of the form in the Designer allow you to switch between the HTML code and VB code. Click on the Source tab to view the static HTML code. HTML creates the visual elements on the page and is automatically generated.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Controls Several types of controls are available for Web Forms and can be mixed on a single form. Very often used are the Standard (ASP.NET server controls) — provided by ASP.NET and the.NET framework. Web server controls don’t directly correspond to HTML controls but are rendered differently for different browsers to achieve desired look/feel.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved ToolBox Controls Toolbox includes tabs for selecting control type. VS Designer adds a small green arrow in the upper-left corner of server controls. ASP Server Control Client-side HTML Control

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Event Handling Events are written in the same way as for Windows controls. Events may actually occur on Client Server Process of capturing an event, sending it to the server, and executing the required methods is all done automatically. Events of Web Forms are somewhat different than for Windows Forms. Example: Web Form has a Page_Load rather than Form_Load.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Files Files in a Web application differ greatly from those in a Windows application. Two files make up the form:.aspx file Holds specifications for the user interface.aspx.vb (“code-behind” file) VB code written to respond to events

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Debugging IDE does not automatically generate code necessary for debugging a Web application — debugging functions need to be added. If running without debugging enabled in the Web.config file, an error message is received. There are two options: Run without debugging Add Web.config file After creating the Web.config file breakpoints, single- step execution, and display, the contents of variable and properties can be set.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Add Web.config File

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Testing In Other Browsers By default, Web projects are tested in Microsoft Internet Explorer. To test in another browser Right-click on the project name Select Browse With

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Laying Out Web Forms Factors that will effect the layout of page: Browsers Screen Sizes Screen Resolutions Window Sizes ASP.NET generates appropriate HTML to render the page in various browsers but cannot be aware of the screen size, resolution, or window size on the target machine.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Using Tables for Layout HTML Tables contain rows and columns. Add controls and text to the table cells to align the columns. Table is an HTML control, requiring no server-side programming.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Entering Controls or Text in a Table Controls can be added to a table cell or type text in a cell during design time. Add a label and give it an ID to be able to refer to the text in a cell at run time. –OR— Type text directly into the cell.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Including Images on Web Pages Use the Image control to add graphics to a Web page. Concept is similar to the PictureBox control on Windows Forms but the graphic file is connected differently due to the nature of the Web applications. Each Image control has an ImageUrl property that specifies the location of the graphic file. To place an image on a Web page, the graphic should first be copied into the Web site folder. Image controls can be added to a cell in a table or directly on a Web page.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Table and Image Place images, text, and controls where you want them by using a table.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Navigating Web Pages Add a HyperLink to allow user to navigate to another site or page. Enter a Text property for the text to display for the user. Enter a NavigateUrl property to specify the URL to which to navigate; the Select URL dialog box displays. Select the page from a list. If wanting to navigate to another Web site, type the Web address as the NavigateUrl property value.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Select URL dialog box Select the page to which to navigate for a HyperLink control from the Select URL dialog box.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Adding a Second Web Page To add a new Web Form to a Web site, select Web Form in the Add New Item dialog box. Make sure to choose Visual Basic for the language and select Place code in separate file.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Using the Validator Controls ASP.NET provides several controls that can automatically validate input data. Steps for using Add a validator control — attach it to an input control and set the error message. At run time, when data is input, the error message displays if the validation rule is violated. Validator controls run on the client side.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Maintaining State Must take steps to maintain values of variables and controls on page. Set EnableViewState to True (default), so control contents reappear for each postback. Local variables in a Web application are re- created each time the procedure begins. Store value of module-level variables in controls to hold their values during postback. Use IsPostBack property to control actions on postback.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Checking for Postback When an ASP.NET application loads, the Page- Load event occurs—the page is reloaded for each “round-trip” to the server (each postback). The Page-Load event occurs many times in a Web application. The page’s IsPostBack property is set to False for the initial page load and to True for all page loads after the first. Check for IsPostBack = True to make sure that actions are only performed on postbacks.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved AJAX Asynchronous JavaScript and XML (AJAX) for creating interactive applications allows to reload only a portion of the Web page, rather than the entire page. AJAX is an open and cross-platform technology that works on many operating systems. Using AJAX, the loading speed can increase dramatically by downloading and rendering only the portion that changes.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved AJAX

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Managing Web Projects Moving and renaming Web projects is easy when using File Systems Web sites as opposed to IIS sites. Make sure the project is closed so that the project folder can be renamed and then it can be moved or copied to different locations or computers.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Using the Copy Web Site Tool Can copy an entire Web site from one location to another on the same computer, or to another computer on a network, or to a remote site Can copy the Web site to a remote server where it can be accessed by multiple users

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Some Web Acronyms (1 of 2) XML Extensible Markup Language. This popular tag- based notation is used to define data and their format and transmit the data over the Web. XML is entirely text based, does not follow any one manufacturer’s specifications, and can pass through firewalls. SOAP Simple Object Access Protocol. An XML-based protocol for exchanging component information among distributed systems of many different types. Since it is based on XML, its messages can pass through network firewall.

McGraw-Hill© 2009 The McGraw-Hill Companies, Inc. All rights reserved Some Web Acronyms (2 of 2) HTTP HyperText Transfer Protocol. The protocol used to send and receive Web pages over the Internet using standardized request and response messages Web Service Code in classes used to provide middle- tier services over the Internet WSDL Web Services Description Language. An XML document using specific syntax that defines how a Web service behaves and how clients interact with the service