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.

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.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 21 – Web Servers (IIS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System.
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.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
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.
17 Web Servers (Apache and IIS)
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
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.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO WEB DATABASE PROGRAMMING
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
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.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
Chapter 1: Introduction to Web
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Server-side Scripting Powering the webs favourite services.
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.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
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.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
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.
Chapter 8 Cookies And Security JavaScript, Third Edition.
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.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
 2008 Pearson Education, Inc. All rights reserved. Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e.
Web Server.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
ASP.NET Part II Dr. Awad Khalil Computer Science Department AUC.
The Internet Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
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.
WWW and HTTP King Fahd University of Petroleum & Minerals
Warm Handshake with Websites, Servers and Web Servers:
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
Unit 27 - Web Server Scripting
17 Web Servers (Apache and IIS)
17 Web Servers (Apache and IIS)
Web App Development with ASP.NET
Web Servers (IIS and Apache)
Web App Development with ASP.NET
Presentation transcript:

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 web content for web-browser clients. Web Form files have the filename extension.aspx and contain the web page’s GUI. You customize Web Forms by adding web controls including labels, textboxes, images, buttons and other GUI components.

Introduction The Web Form file represents the web page that's sent to the client browser. We often refer to Web Form files as ASPX files. An ASPX file created in Visual Studio has a corresponding class written in a.NET language This class contains event handlers, initialization code, utility methods and other supporting code. The file that contains this class is called the code-behind file and provides the ASPX file’s programmatic implementation.

Web Basics In its simplest form, a web page is nothing more than an HTML (HyperText Markup Language) document (with the extension.html or.htm) that describes to a web browser the document’s content and how to format it. HTML documents normally contain hyperlinks that link to different pages or to other parts of the same page. When the user clicks a hyperlink, a web server locates the requested web page and sends it to the user’s web browser.

Web Basics (cont.) Require a server and a client Server sends the Web Pages to the Client. Client displays the Web Pages in Browser.

Web Basics (cont.) URIs and URLs URIs (Uniform Resource Identifiers) identify resources on the Internet. URIs that start with are called URLs (Uniform Resource Locators). Common URLs refer to files, directories or server-side code that performs tasks such as database lookups, Internet searches and business app processing.

Web Basics (cont.) Parts of a URL A URL contains information that directs a browser to the resource that the user wishes to access. Web servers make such resources available to web clients. Popular web servers include Microsoft’s Internet Information Services (IIS), Apache’s HTTP Server.

Web Basics (cont.) URL: The indicates that the HyperText Transfer Protocol (HTTP) should be used to obtain the resource. ◦HTTP is the web protocol that enables clients and servers to communicate. Next in the URL is the server’s fully qualified hostname ( name of the web server computer on which the resource resides. ◦This computer is referred to as the host, because it houses and maintains resources. ◦The hostname is translated into an IP (Internet Protocol) address—a numerical value that uniquely identifies the server on the Internet.

Multitier App Architecture Web-based apps are multitier apps (sometimes referred to as n-tier apps).

Your First Web App Our first example displays the web server’s time of day in a browser window. When this app executes—that is, a web browser requests the app’s web page—the web server executes the app’s code, which gets the current time and displays it in a Label. The web server then returns the result to the web browser that made the request, and the web browser renders the web page containing the time.

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.

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.

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.

Validation Controls Validation controls or validators, determine whether the data in another web control is in the proper format. For example, validators can determine whether a user has provided information in a required field or whether a zip- code field contains exactly five digits. Validators provide a mechanism for validating user input on the client and the server. When the page is sent to the client, the validator is converted into JavaScript that performs the validation in the client web browser.

Validation Controls (cont.) JavaScript is a scripting language that enhances the functionality of web pages and is typically executed on the client. Unfortunately, some client browsers might not support scripting or the user might disable it. For this reason, you should always perform validation on the server. ASP.NET validation controls can function on the client, on the server or both.

Validation Controls (cont.) Validating Input in a Web Form The previous Web Form prompts the user to enter a name, address and phone number. After the user enters any data, but before the data is sent to the web server, validators ensure that the user entered a value in each field and that the address and phone-number values are in an acceptable format.

Validation Controls (cont.) ASP.NET 4.5 Unobtrusive Validation Prior to ASP.NET 4.5, when you used the validation controls presented in this section, ASP.NET would embed substantial amounts of JavaScript code in a web page to perform the work of the validation controls in the client web browser. ASP.NET 4.5 now uses unobtrusive validation, which significantly reduces the amount of JavaScript that gets embedded into the web page—this, in turn, can improve the performance of your website by making pages load faster.

Validation Controls (cont.) Differentiating Between the First Request to a Page and a Postback ◦ Web programmers using ASP.NET often design their web pages so that the current page reloads when the user submits the form; this enables the program to receive input, process it as necessary and display the results in the same page when it’s loaded the second time. ◦ These pages usually contain a form that, when submitted, sends the values of all the controls to the server and causes the current page to be requested again. ◦ This event is known as a postback. ◦ The first time that the web page is requested, IsPostBack is false, when the postback occurs (from the user clicking Submit ), IsPostBack is true.

Validation Controls (cont.) Server-Side Web Form Validation Server-side Web Form validation must be implemented programmatically. Use the Page ’s Validate method to validate the information in the request. ◦ This validates the information as specified by the validation controls in the Web Form. The IsValid property of class Page to check whether the validation succeeded. If this property is set to True (that is, validation succeeded and the Web Form is valid), then we display the Web Form’s information. Otherwise, the web page loads without any changes, except that any validator that failed now displays its ErrorMessage.

Session Tracking Originally, critics accused the Internet and e-business of failing to provide the customized service typically experienced in “brick-and-mortar” stores. To address this problem, businesses established mechanisms by which they could personalize users’ browsing experiences, tailoring content to individual users. Businesses can achieve this level of service by tracking each customer’s movement through the Internet and combining the collected data with information provided by the consumer, including billing information, personal preferences, interests and hobbies.

Session Tracking (cont.) Personalization Personalization makes it possible for businesses to communicate effectively with their customers and also improves users’ ability to locate desired products and services. Companies that provide content of particular interest to users can establish relationships with customers and build on those relationships over time. Furthermore, by targeting consumers with personal offers, recommendations, advertisements, promotions and services, businesses create customer loyalty.

Session Tracking (cont.) Privacy A trade-off exists between personalized business service and protection of privacy. Some consumers embrace tailored content, but others fear the possible adverse consequences if the info they provide to businesses is released or collected by tracking technologies. Consumers and privacy advocates ask: What if the business to which we give personal data sells or gives that information to other organizations without our knowledge?

Session Tracking (cont.) Recognizing Clients To provide personalized services to consumers, businesses must be able to recognize clients when they request information from a site. As we’ve discussed, the request/response system on which the web operates is facilitated by HTTP. Unfortunately, HTTP is a stateless protocol—it does not provide information that would enable web servers to maintain state information regarding particular clients.

Cookies Cookies provide you with a tool for personalizing web pages. A cookie is a piece of data stored by web browsers in a small text file on the user’s computer. A cookie maintains information about the client during and between browser sessions. The first time a user visits the website, the user’s computer might receive a cookie from the server; this cookie is then reactivated each time the user revisits that site. The collected information is intended to be an anonymous record containing data that's used to personalize the user’s future visits to the site.