Web Forms, HTML, and ASP.NET

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

Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
1 Chapter 12 Working With Access 2000 on the Internet.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Chapter 14 Introduction to HTML
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.
HTML Comprehensive Concepts and Techniques Intro Project Introduction to HTML.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO WEB DATABASE PROGRAMMING
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
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.
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 1: Introduction to 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.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
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.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML Concepts and Techniques Fifth Edition Chapter 1 Introduction to HTML.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
Web Page Programming Terms. Chapter 1 Objectives Describe Internet and Understand Key terms Describe World Wide Web and its Key terms Identify types and.
National College of Science & Information Technology.
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.
4.01 How Web Pages Work.
Web Programming Language
Chapter 5 Validating Form Data with JavaScript
4.01 How Web Pages Work.
Computing with C# and the .NET Framework
ASP.NET Forms.
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Chapter 1 Introduction to HTML
WWW and HTTP King Fahd University of Petroleum & Minerals
Chapter 1 Introduction to HTML.
Project 1 Introduction to HTML.
Section 17.1 Section 17.2 Add an audio file using HTML
Client side & Server side scripting
Chapter 27 WWW and HTTP.
Web Page Concept and Design :
Static and Dynamic Web Pages
Introduction to HTML Simple facts yet crucial to beginning of study in fundamentals of web page design!
Chapter 16 The World Wide Web.
Chapter 9 Programming with Web Forms
An Introduction to JavaScript
4.01 How Web Pages Work.
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

Web Forms, HTML, and ASP.NET Chapter 12 Web Forms, HTML, and ASP.NET Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Objectives In this chapter, you will: Review Internet and Web fundamentals Review HTML basics Use HTML forms Use ASP.NET to develop Web pages Create an ASP.NET Web application Create an ASP.NET survey application Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Introduction Internet An interconnected system of networks that links computers worldwide Protocol used: Transmission Control Protocol/Internet Protocol (TCP/IP) Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Introduction World Wide Web (or the Web) Largest and perhaps most important segment of the Internet Has graphics and animation capabilities Protocol used to process information: Hypertext Transmission Protocol (HTTP) Language used to present information: Hypertext Markup Language (HTML) Web browser Uses HTML to render Web information for a particular display device Object-Oriented Application Development Using VB .NET

Understanding Internet and Web Fundamentals The Web is based on a client-server architecture A form of distributed computing in which software is split between Server tasks Client tasks Uniform Resource Locator (URL) Used to identify and access a Web server Generally called a Web address Object-Oriented Application Development Using VB .NET

Understanding Internet and Web Fundamentals A Web page A file with an .htm or .html extension Contains HTML; might also contain other code Stored on a server Object-Oriented Application Development Using VB .NET

Static and Dynamic Web Pages Static Web pages Contain HTML tags only Simply display information Content does not change when requested by the user Object-Oriented Application Development Using VB .NET

Static and Dynamic Web Pages Object-Oriented Application Development Using VB .NET

Static and Dynamic Web Pages Content changes depending on the user’s request or preferences Cannot be created using HTML alone Object-Oriented Application Development Using VB .NET

Static and Dynamic Web Pages Dynamic Web pages can be created using Client-side code Server-side code Server-side technologies for providing dynamic content ASP ASP.NET Common Gateway Interface (CGI) Java Server Pages (JSP) ColdFusion Personal Hypertext Preprocessor (PHP) Object-Oriented Application Development Using VB .NET

Static and Dynamic Web Pages Classic ASP Allows creation of dynamic Web pages through: Embedding of program scripts in HTML Scripts are created using scripting languages, such as: VBScript JavaScript Now being supplanted by ASP.NET Object-Oriented Application Development Using VB .NET

Setting Up an IIS Server Internet Information Services (IIS) A Microsoft server software Must be used to use Microsoft’s Web development technology Ships with Windows 2000 Windows XP Professional Object-Oriented Application Development Using VB .NET

Working with Web Directories Folders on a server can be specified using either A physical directory A directory physically located in the Web site’s root directory A virtual directory A directory that does not have to be physically located in the Web site’s root directory Object-Oriented Application Development Using VB .NET

Working with Web Directories Benefits of virtual directories Shorter URLs Easier to reference Hide the physical directory structure Helps to avoid security risks Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Reviewing HTML Basics HTML tags Define the format of a Web page Are predefined – have no relationship to the text they are marking Consist of A left angle bracket (<) A tag name A right angle bracket (>) Many come in pairs: A start tag An end tag: uses a slash (/) to differentiate it from a start tag May have attributes Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Reviewing HTML Basics HTML Element: the complete line, start tag through end tag Content: the part between the tags Empty elements or single tags For example: <BR> tag Code is not case sensitive Object-Oriented Application Development Using VB .NET

Exploring HTML Documents Text or ASCII files Can be created using A text editor Visual Web development tools which use WYSIWYG For example: Microsoft FrontPage Macromedia Dreamweaver Object-Oriented Application Development Using VB .NET

Exploring HTML Documents <HTML></HTML> tag pair Designates the beginning and end of the HTML document HEAD tags Provide a section for documentation TITLE tags Contain content that is displayed on the browser’s title bar BODY tags Optional, but usually needed by Web pages Object-Oriented Application Development Using VB .NET

Exploring HTML Documents Object-Oriented Application Development Using VB .NET

Exploring HTML Documents Table 12-1: Common HTML Tags (continued) Object-Oriented Application Development Using VB .NET

Exploring HTML Documents Object-Oriented Application Development Using VB .NET

Working with Images and Hyperlinks Image tag (<IMG>) Used to add images to Web pages References a graphic image Source attribute (SRC) Contains the location of the graphic image Can use absolute or relative path referencing Object-Oriented Application Development Using VB .NET

Working with Images and Hyperlinks Hyperlinks (shortened name for hypertext links) Provide the capability to branch to A specified location in the current HTML document Other HTML documents in your Web site Other Web pages at another Web site E-mail addresses The physical link can be A single word Several words An image Object-Oriented Application Development Using VB .NET

Working with Images and Hyperlinks Figure 12-12 shows a Web page with a hyperlink and an image Object-Oriented Application Development Using VB .NET

Working with Images and Hyperlinks Layout of the information on a Web page Can make the Web page easy or difficult to access and use Can be designed using HTML tables HTML tables provide a way to precisely control spacing Object-Oriented Application Development Using VB .NET

Working with Images and Hyperlinks Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Using HTML Forms HTML forms Collect user data Send the input values to the server with the user’s request Server program Accesses the user data and responds accordingly by: Dynamically creating an appropriate Web page Returning Web page to the client browser Created using the form tag pair (<form> </form>) Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Using HTML Forms Attributes of the start form tag NAME: sets the form name METHOD: can be set to POST or GET POST – user data is placed in the form collection of the request object to be passed to the server GET – user data is passed to the server by adding it to the end of the URL address ACTION: specifies to what file program control is transferred when the Web page is submitted Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Using Form Controls HTML form controls Similar to many of the controls used in the Windows environment Also called form elements Most have ASP.NET equivalents Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Using Form Controls Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Using Form Controls Object-Oriented Application Development Using VB .NET

Classic ASP Web Development Has been a very popular technology for building Web applications Dubbed “Classic ASP” since the introduction of ASP.NET ASP.NET is based upon and uses parts of ASP Allows the mixing of scripts with HTML code A file with the .asp extension is processed with the ASP script engine on the server Object-Oriented Application Development Using VB .NET

Classic ASP Web Development ASP allows Client-side processing Server-side processing Client-side scripting Validates data before sending it to the server Used for Web page presentation effects Server-side scripting Accepts user inputs Obtains data from a database, if required Processes, renders, and returns a Web page Object-Oriented Application Development Using VB .NET

Classic ASP Web Development Object-Oriented Application Development Using VB .NET

Using ASP.NET to Develop Web Pages Goal of the .NET framework and VS .NET Provide an integrated development environment (IDE) to support the development Windows applications Web applications Object-Oriented Application Development Using VB .NET

Separating Code from Content Typical ASP Page includes programming script mixed with HTML tags Difficult to cleanly separate the code from presentation and content ASP.NET Separates Web page code from content and presentation (the GUI) Object-Oriented Application Development Using VB .NET

Separating Code from Content ASP.NET Uses the code-behind technique, which: Mimics the event-driven code-behind concept for Windows applications Web form file Contains presentation and content Has an .aspx extension Code-behind file Contains the code Has an .aspx.vb extension Object-Oriented Application Development Using VB .NET

Separating Code from Content Object-Oriented Application Development Using VB .NET

Using HTML, HTML Server Controls, and ASP.NET Server Controls ASP.NET can be used to develop Web applications using HTML HTML server controls ASP.NET server controls Object-Oriented Application Development Using VB .NET

Understanding the ASP.NET Page Event Life Cycle ASP.NET Page class has its own Properties Methods Events ASP.NET page event life cycle Page_Init event Fired when a page is requested Occurs before the controls are loaded onto the Web form Can be used to handle data connection and initialization Object-Oriented Application Development Using VB .NET

Understanding the ASP.NET Page Event Life Cycle ASP.NET page event life cycle (continued) Page_Load event Occurs after the Page_Init event Typically provides the location where the code to check for postback is included Postback Second and subsequent requests for a Web form page Can be used to write code that is executed only on the first request for the Web page form Object-Oriented Application Development Using VB .NET

Understanding the ASP.NET Page Event Life Cycle ASP.NET page event life cycle (continued) Page_Unload event Occurs After the page has been unloaded Before the page is sent to the browser Used to clean up processing before the page is unloaded Closing files and connections to data Disposing of unneeded objects Object-Oriented Application Development Using VB .NET

Understanding the ASP.NET Page Event Life Cycle Object-Oriented Application Development Using VB .NET

Creating an ASP.NET Web Application In VS .NET, a ASP.NET Web application can be created by Clicking the New Project button on the Start Page Clicking Visual Basic Projects in the Project Types list, if necessary Clicking the ASP.NET Web Application icon in the Templates list Object-Oriented Application Development Using VB .NET

Creating an ASP.NET Web Application Options for adding a control to the Web form Double-click the control on the Toolbox Select and drag the control onto the Web form runat=“server” attribute Specifies that the control will be processed on the server Exists for all the ASP.NET controls Can be added to an HTML control to make it an HTML server control Object-Oriented Application Development Using VB .NET

Creating an ASP.NET Web Application Choice of how to work in the ASP.NET environment Design view HTML view Object-Oriented Application Development Using VB .NET

Creating an ASP.NET Survey Application An application for Bradshaw Marina that consists of: A form to collect information about boat customers A Web page where the information from the first form is posted Object-Oriented Application Development Using VB .NET

Using the Code-Behind Window This application requires Navigation from one Web page to another Passing the collected data from the source Web page to the target Web page To accomplish this, the application: Uses custom page properties Redirects program control from the source Web page to another Web page Object-Oriented Application Development Using VB .NET

Using the Code-Behind Window Object-Oriented Application Development Using VB .NET

Creating the Results Web Page Requires the addition of a new Web form to the project Object-Oriented Application Development Using VB .NET

Creating the Results Web Page To add a new Web form to the project Right-click the project in the Solutions Explorer window Point to Add Select Add Web Form on the shortcut menu Object-Oriented Application Development Using VB .NET

Using ASP.NET Validation Controls Data validation An important part of any application that accepts user input Object-Oriented Application Development Using VB .NET

Adding Validation Controls to the Survey Web Page Validation controls added to the survey Web page RequiredFieldValidator controls added to Text box controls for First name Last name Desired slip features The radio button list ValidationSummary control added to The Panel control Object-Oriented Application Development Using VB .NET

Adding Validation Controls to the Survey Web Page Object-Oriented Application Development Using VB .NET

Using ASP.NET with a PD Class Example: Customer data entry Web form Used to create a number of Customer instances Results Web form Displays the values for each Customer instance that is created Displays all the Customer instances in a text box Allows the user to enter a phone number to locate a customer in the ArrayList of customers Object-Oriented Application Development Using VB .NET

Using ASP.NET with a PD Class Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Summary The Web uses the HTTP protocol and the HTML markup language Web applications can be static or dynamic HTML tags are used by browsers to render Web pages for display on display devices Web applications use a client-server computing architecture Web processing is based on the Request/Response model Object-Oriented Application Development Using VB .NET

Object-Oriented Application Development Using VB .NET Summary HTML forms have controls that allow for user input on a Web page to be sent to the server for processing Classic ASP is used to create dynamic Web applications by mixing programming script with HTML code ASP.NET clearly separates code from a Web page’s presentation and content ASP.NET has validation controls to help ensure that valid data is entered into Web pages Object-Oriented Application Development Using VB .NET