Web-Based Applications

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

11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
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.
1 Chapter 12 Working With Access 2000 on the Internet.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
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.
Building an ASP.NET Web Application Dr. Awad Khalil Computer Science & Engineering Department AUC.
 Using Microsoft Expression Web you can: › Create Web pages and Web sites › Set what you site will look like as you design it › Add text, images, multimedia.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
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.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
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.
HTML, GUI, ASP.NET Rina Zviel-Girshin Lecture 2
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
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.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web 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.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
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.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
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 
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
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.
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
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.
ASP.NET Forms.
Web Forms, HTML, and ASP.NET
Web Development in Microsoft Visual Studio 2013
Static and Dynamic Web Pages
ASP.NET.
Web Development Using ASP .NET
Chapter 9 Programming with Web Forms
Tutorial 7 – Integrating Access With the Web and With Other Programs
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

Web-Based Applications 15 Web-Based Applications C# Programming: From Problem Analysis to Program Design 3rd Edition C# Programming: From Problem Analysis to Program Design

Chapter Objectives Discover how Web-based applications differ from Windows applications Use ASP.NET to create Web applications Develop and configure Web Forms pages Learn about different types of controls that can be added to Web applications Add HTML and Web Forms server controls to Web applications C# Programming: From Problem Analysis to Program Design

Chapter Objectives (continued) Add validation, custom, and composite controls to verify user input, display calendars, and connect to database tables Become aware of Web Services and their implications for distributed applications Learn how mobile applications are developed using the Compact Framework (optional) C# Programming: From Problem Analysis to Program Design

Web-Based Applications Runs within an Internet browser Collection of one or more related files or components stored on a server Web server is software that hosts or delivers Web application Hardware at location where Web server software is loaded is often called a Web server It is the software that makes the equipment special and thus enables the computer to be called a server C# Programming: From Problem Analysis to Program Design

Web Programming Model MessageBox dialog boxes are not used with Web applications Output would be displayed on the server Output displayed through Label or other objects on Web page Each request to view a Web page requires round trip to the server Requests page via Hypertext Transfer Protocol (HTTP) Page sent back as Hypertext Markup Language (HTML) document C# Programming: From Problem Analysis to Program Design

Web Programming Model (continued) Page is rendered – converted from HTML upon return to the browser Every postback trip to the server creates new object Causes Web pages to be stateless Pages do not retain their values from one trip to the Web server to the next C# Programming: From Problem Analysis to Program Design

Static Pages Client-side application Provide no interaction with the user Does not require any processing on the client computer or by a Web server Precreated pages residing on the server's hard drive Delivered as HTML documents HTML file contains formatting markup tags C# Programming: From Problem Analysis to Program Design

Dynamic Pages Involve processing in addition to rendering the formatting HTML tags One programming model is to use traditional or classic Active Server Pages (ASP) Includes script code in the HTML file – client-side scripts Server-side scripts require processing to be done at the server level before page is delivered VBScript and JavaScript – scripting languages C# Programming: From Problem Analysis to Program Design

Dynamic Pages (continued) Figure 15-2 Server-side processing of a dynamic Web page C# Programming: From Problem Analysis to Program Design

ASP.NET Does not require writing code in a separate scripting language Includes a number of classes as part of the .NET Framework To identify an ASP from an ASP.NET Web application, look at file extensions ASP Web page ends with an .asp file extension ASP.NET Web page ends with an .aspx file extension C# Programming: From Problem Analysis to Program Design

ASP.NET (continued) Two options for developing ASP.NET applications Use the new ASP.NET Development Server Available with Visual Studio 2005 and Visual Web Developer Preferred option for developing and testing applications from a directory on a local machine Second option: use Microsoft Internet Information Services (IIS) C# Programming: From Problem Analysis to Program Design

Visual Web Developer Includes built-in ASP.NET development server WYSIWYG – drag-and-drop approach to design Includes features to publish applications Includes option to create a File System Web site Store and run your Web application in any directory on your local machine Get the same functionality included as part of Visual Studio C# Programming: From Problem Analysis to Program Design

IIS option To use this option, Microsoft Internet Information Services (IIS) must be installed IIS provides software tools for managing Web server IIS requires a server-like operating system IIS component should be installed before loading the .NET Framework C# Programming: From Problem Analysis to Program Design

ASP.NET Programming Models Model-View-Controller (MVC) Separates application into three attributes Model – info for app is described, including data and validation rules View described through HTML markup Controller contains the control-flow logic, which describes interaction between the Model and View Lower level – doesn’t provide widget controls Web Forms Page C# Programming: From Problem Analysis to Program Design

Web Forms Page System.Web.UI namespace Namespace includes Control class, inherited by the HTMLControl and WebControl classes Namespace also includes Page class Web applications designed with event-driven model, but there are fewer events Web Forms page instead of Windows Forms Build an ASP.NET Web application; two separate files are created C# Programming: From Problem Analysis to Program Design

Web Forms Page (continued) Web Forms page file Stores visual elements Container file from which the controls are displayed Contains static HTML tags Code-behind file Where the programming logic resides Stores event-handler methods C# Programming: From Problem Analysis to Program Design

By default, projects are created at http://localhost Creating a Web Site By default, projects are created at http://localhost when HTTP is selected Figure 15-3 Web application template for ASP.NET C# Programming: From Problem Analysis to Program Design

Creating a Web Site (continued) Unlike sites created with IIS, you can select any directory location on local machine Files are not stored at localhost (c:\Inetpub\wwwroot) Create Web page using File > New > Web Site instead of File > New > Project Open existing Web page File > Open > Web Site C# Programming: From Problem Analysis to Program Design

Creating a Web Site (continued) Selecting File System option enables you to specify where the Web site files are stored on your local machine Figure 15-4 Opening an existing Web site C# Programming: From Problem Analysis to Program Design

Web Page File ending in .aspx holds the HTML tags View and directly edit the HTML source Tags are automatically inserted for head, title, body, form, and div First two lines in the .aspx markup file are called page directives Page directives are delimited with <%@ and %> Language is identified and CodeFile name is listed AutoEventWireup attribute set to true Event-handler methods in the class are used C# Programming: From Problem Analysis to Program Design

Web Page (continued) Figure 15-5 Source code for HTML file SelectedSource tab Figure 15-5 Source code for HTML file C# Programming: From Problem Analysis to Program Design

Web Page (continued) Figure 15-6 HTML document in Design mode SelectedDesign tab Figure 15-6 HTML document in Design mode C# Programming: From Problem Analysis to Program Design

Master Pages Allow you to create and maintain a consistent theme across several pages for a Web site One of nodes listed in the Solution Explorer window is Site.master (master page) Automatically created when you create New Web Site in Visual Studio 2010 File ends with an extension of .master Contains formatting HTML tags Can include static text, HTML, and server controls C# Programming: From Problem Analysis to Program Design

Master Pages (continued) Figure 15-7 Site.master Master page C# Programming: From Problem Analysis to Program Design

Master Pages (continued) Default.aspx page has a special @ Master directive instead of @ Page directive Master pages consist of two pieces: master page itself and one or more content pages When users request content pages, master page is merged with content page to produce output Master page has one or more ContentPlaceHolders defined with an ID C# Programming: From Problem Analysis to Program Design

Master Pages (continued) Lines 6 through 13 provide the content for the MainContent ContentPlaceHolders Figure 15-8 MainContent in the About.aspx page C# Programming: From Problem Analysis to Program Design

Master Pages (continued) Figure 15-9 MainContent in the Default.aspx page C# Programming: From Problem Analysis to Program Design

Cascading Style Sheet (CSS) CSS enables more consistency across pages Able to separate actual content from the appearance Uses style sheets to describe how elements will look in terms of their layout, fonts, and colors Syntax for the language used by CSS is very high level—close to English CSS uses a number of keywords to describe different style properties Ends with .css file extension C# Programming: From Problem Analysis to Program Design

Cascading Style Sheet (continued) Style sheet is very readable and easy to modify Figure 15-10 Site.css C# Programming: From Problem Analysis to Program Design

Cascading Style Sheet (continued) Can go directly into the Sites.css file and type new values or add additional property lines OR, use the Modify Style configuration wizard Figure 15-11 Modify Style C# Programming: From Problem Analysis to Program Design

Code-Behind File Initially looks similar to Windows applications, but it is different No Main( ) method Page_Load( ) event handler Contains many namespaces imported automatically Can debug and execute Web application from within the IDE Default Web browser is launched C# Programming: From Problem Analysis to Program Design

Code-Behind File (continued) Figure 15-12 Code-behind file C# Programming: From Problem Analysis to Program Design

Code-Behind File (continued) Auto generated code not created for applications until you run the application No hidden .designer.cs file as with Windows apps Default.aspx created and automatically opened in Source view when you first start building a Web site App_Data folder is automatically created Reserved for storing data files C# Programming: From Problem Analysis to Program Design

ASP.NET Empty Web Site No files are created when you select File, New,Web Site, ASP.NET Empty Web Site No extra folders are created To get the .aspx file added, select Add New Item, Web Form from Solution Explorer window Code-behind file (.aspx.cs) is then created Like Windows applications, can set some properties during design using Properties window Adds code to .aspx, file containing the HTML tags C# Programming: From Problem Analysis to Program Design

HTML Document File Page object properties – fewer (and named differently) than available Windows Form object C# Programming: From Problem Analysis to Program Design

HTML Document File (continued) C# Programming: From Problem Analysis to Program Design

Controls Standard HTML AJAX Extensions WebParts Validation Navigation Login Dynamic Data Reporting C# Programming: From Problem Analysis to Program Design

Controls (continued) Toolbox controls available in Design Source mode Drag and drop controls onto the .aspx Source (HTML) markup page as easily as you drop it on Design page Several different types of controls available in Toolbox Most Web Forms controls you will be using are stored under the Standard node on the Toolbox C# Programming: From Problem Analysis to Program Design

HTML Controls Client side controls Can be added to your page using a WYSIWYG drag-and-drop approach Limited number of HTML controls Have a special Block Format tool on the Formatting toolbar Enables you to select a segment of text and apply styles like heading tags or create ordered or unordered lists C# Programming: From Problem Analysis to Program Design

HTML Controls (continued) Figure 15-13 Block format for design mode C# Programming: From Problem Analysis to Program Design

Adding HTML Controls Figure 15-14 HTML controls C# Programming: From Problem Analysis to Program Design

HTML Controls (continued) HTML controls do not maintain state Values in text boxes lost when Submit clicked Figure 15-15 Submit button clicked C# Programming: From Problem Analysis to Program Design

HTML Server Controls You can give the server access to the values entered by the user runat=”server” attribute Running HTML Controls as Server Controls runat=”server” attribute is automatically added to the tags for these controls C# Programming: From Problem Analysis to Program Design

Server Control Events private void btnSubmit_ServerClick(object sender, EventArgs e) { this.lblResult.Text = "Thanks!! " + this.txtFirst.Value + " " + this.txtLast.Value + " Information will be forwarded to: " + this.txtEmail.Value; } Text property used with Label Value property used with Text Field C# Programming: From Problem Analysis to Program Design

Server Control Events (continued) Number in address bar following localhost (as the port number) is a relatively random number, placed there when you specify the Location as File System Figure 15-16 Web page after postback C# Programming: From Problem Analysis to Program Design

Web Forms Standard Server Controls Can mix and match HTML and Standard controls on your page Web Forms Server Controls referred to as Standard controls Also referred to as Web Server controls, Web controls, ASP server controls, or simply Web Forms controls C# Programming: From Problem Analysis to Program Design

Available Web Forms Controls Standard Controls have more built-in features than HTML controls Look and act like their Windows counterparts (Fewer controls and fewer events to program) Use object-oriented model Web Forms controls do not map straight to HTML Often it may take several HTML tags to represent one Web Forms control C# Programming: From Problem Analysis to Program Design

Web Forms Server Controls (continued) Figure 15-17 Web Forms server standard controls C# Programming: From Problem Analysis to Program Design

Web Forms Server Controls (continued) Visual Studio prefixes the control name with <asp:control and ends the tag with /asp:control> Also runat= "server " appended <asp:control attributes runat="server " /asp:control> Stored in HTML document – file ending with .aspx extension C# Programming: From Problem Analysis to Program Design

Web Forms Controls of the Common Form Type Fewer properties found with Web Forms types of controls than you find with their Windows Forms counterparts Control’s properties, like Windows apps, can be set using the Properties window in Visual Studio Settings (visual) are stored in the HTML document – the file ending with the .aspx extension C# Programming: From Problem Analysis to Program Design

Changing Properties within Visual Studio Comparison of Windows Forms button with Web Forms Standard button control object Windows Forms button: 58 events Web Forms Standard button control: 6 events Windows Forms button control: 50 properties Web Forms Standard button control: 23 properties C# Programming: From Problem Analysis to Program Design

Changing Properties within Visual Studio (continued) Figure 15-18 Properties for the Label control object C# Programming: From Problem Analysis to Program Design