Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media.

Slides:



Advertisements
Similar presentations
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
Advertisements

Languages for Dynamic Web Documents
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
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.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.
OOP and Web Applications Michael Juřek Architect Evangelist Microsoft Corporation.
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.
JavaScript & jQuery the missing manual Chapter 11
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
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.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
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.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
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.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
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.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
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 
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
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.
Introduction to JavaScript CS101 Introduction to Computing.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
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.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Module 4: Creating a Web Application with Web Forms
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
ASP.NET Forms.
Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser.
Web Forms, HTML, and ASP.NET
Unit 27 - Web Server Scripting
Web Development in Microsoft Visual Studio 2013
Module 10: Creating a Web Application with Web Forms
Web Development Using ASP .NET
Presentation transcript:

Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media Department Politeknik Brunei WEBFORMS

Introduction to Web Forms Configuration – Client Side Scripting State Management Contents 2

Web Forms the heart and soul of ASP.NET. Are the User Interface (UI) elements that give your Web applications their look and feel. Similar to Windows Forms in that they provide properties, methods, and events for the controls that are placed onto them. Web Forms 3

However, these UI elements render themselves in the appropriate markup language required by the request e.g. HTML. If you use Microsoft Visual Studio®.NET, you will also get the familiar drag-and-drop interface used to create your UI for your Web application. Web Forms 4

Web Forms are made up of two components: the visual portion (the ASPX file) the code behind the form, which resides in a separate class file. ASP.NET Web Forms 5

6 Browser IIS Internet Information Services ASP.NET WebForms.NET Language (VB, C#, C++, etc) WebControls

Web Forms and ASP.NET were created to overcome some of the limitations of ASP. These new strengths include: Separation of HTML interface from application logic A rich set of server-side controls that can detect the browser and send out appropriate markup language such as HTML Less code to write due to the data binding capabilities of the new server-side.NET controls Web Forms Purposes 7

Event-based programming model that is familiar to Microsoft Visual Basic® programmers Compiled code and support for multiple languages, as opposed to ASP which was interpreted as Microsoft Visual Basic Scripting (VBScript) or Microsoft Jscript® Allows third parties to create controls that provide additional functionality Web Forms Purposes 8

In simple words, Web Forms seem just like a workspace where you draw controls. In reality, they can do a whole lot more. But normally you will just place any of the various controls onto the Web Form to create your UI. The controls you use determine which properties, events, and methods you will get for each control. Web Forms Purposes 9

There are two types of controls that you can use to create your user interface: HTML controls Web Form controls. Control Interface10

HTML controls mimic the actual HTML elements that you would use if you were using Front Page or any other HTML editor to draw your UI. You can use standard HTML elements in Web Forms, too. For example, if you wanted to create a text box, you would write: HTML Control11

Using Visual Studio.NET, choose a TextField control from the HTML Toolbox tab and draw the control where you want it on the HTML page. Any HTML element can be marked to also run as an HTML control when the Web Form is processed on the server by adding "runat=server" to the tag: HTML Control12

ButtonReset ButtonSubmit Button Text FieldText AreaFile Field Password FieldCheckBoxRadio Button TableImageListBox DropdownHorizontal Rule HTML Control13  Web Form Code Example: Button Text Field Password Field Table

Some of the common client-side events: Client-side Events14 ControlDescription OnBlurText Area OnChangeContents of the control are changed OnClickControl is clicked on OnFocusControl receives focus OnMouseOverMouse moves over this control

15 Web Form controls are created and run on the Server just like the HTML controls. After performing whatever operation they are designed to do, they render the appropriate HTML and send that HTML into the output stream.

16 For example, aDropDownList control will allow you to bind to a data source, yet the output that is rendered is standard and tags when sent to a browser.

17 All Web Form controls inherit from a common base class, namely the System.Web.UI.WebControls class. This base class implements a set of common properties that all of these controls will have. Some of these common properties are: BackColorEnabled FontForeColor VisibleWidth

18 The list of some Web Form server side controls and the server-side events that you can respond to with each control ControlCommonly Used Server-side Events LabelNone TextBoxTextChanged ButtonClick, Command LinkButtonClick, Command ImageButtonClick

19 All of these controls change their output based on the type of browser detected for the user. If the user's browser is IE, a richer look and feel can be generated using some DHTML extensions. If a down-level browser is detected (something other than IE), normal HTML 3.2 standard is sent back to the user's browser.

20 Validates data on the client browser, before the user submits the data to the back-end server. If the user fills in some data into a group of controls on an HTML page, you normally have to send all the data back to the server so it can be validated by either your ASP or ASP.NET code.

RequiredFieldValidator CompareValidator RangeValidator RegularExpressionValidator CustomValidator Field Validator Controls 21  These Field Validator controls allows you to check the user’s input without a round trip back to the server

22 In addition to the built-in controls in the.NET Framework, you can also build your own custom controls. For example, you may wish to create a menu system where each menu item is built from a database.

Page Events Pages are structured using events Enables clean code organization Avoids the “Monster IF” statement Less complex than ASP pages Code can respond to page events E.g. Page_Load, Page_Unload Code can respond to control events Button_Click Textbox_Changed 23

Page life cycle Textbox1_Changed Button1_Click Initialize Load Page Page Clean up Page_Load Page_Unload Page_Init Server control events Page_render Handle Event 24

Page Loading Page_Load fires at beginning of request after controls are initialized Input control values already populated protected void Page_Load(Object s, EventArgs e) { message.Text = textbox.Text; } 25

Page Loading Page_Load fires on every request Use Page.IsPostBack to execute conditional logic If a Page/Control is maintaining state then need only initialize it when IsPostBack is false protected void Page_Load(Object s, EventArgs e) { if (! Page.IsPostBack) { // Executes only on initial page load Message.Text = "initial value"; } // Rest of procedure executes on every request } 26

Server Control Events Change Events By default, these execute only on next action event, e.g. OnTextChanged, OnCheckedChanged Change events fire in random order Action Events Cause an immediate postback to server E.g. OnClick 27

Server Control Events Works with any browser No client script required, no applets, no ActiveX ® Controls! 28

Page Unloading Page_Unload fires after the page is rendered Useful for logging and clean up protected void Page_Unload(Object s, EventArgs e) { MyApp.LogPageComplete(); } 29

Configuration Client Side Scripting 30

Add functionality and interactivity to our website HTML is limited to displaying and formatting content Client-side scripting also reduced burden on servers. Data validation can be performed at client side via web browser instead at web server Client Side Scripting 31

It also extends browser capabilities such as those offered by Shockwave for animation Basically in client-side scripting, all processing are done at client side through the web browser Client Side Scripting 32

Improve/better user experience: Allow for more interactivity by promptly responding to users' actions. Immediate response as scripts are executed by web browser. Improve website usability if browser supports scripting technology. Developers have more control over the appearance and behavior of widgets. Advantages of Client Side Scripting33

Not all browsers support script and some users even have this feature turned off. Websites relying on script solely may become non-functional or look erroneous. Require rigorous testing as scripts may behave differently on different browsers / browser versions. Writing your own script takes considerable amount of time and effort. Disadvantages of Client Side Scripting 34

Since developers have direct control over widget appearance and behavior, their design might affect web usability. For example a widget that looks like a “submit” button but with different function or effects. Disadvantages of Client Side Scripting 35

State Management 36

A new instance of the Web page class is created each time the page is posted to the server. In traditional Web programming, this would typically mean that all information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server. State Management 37

To overcome this inherent limitation of traditional Web programming, ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis. These features are as follows: View state Hidden fields Query strings Session state State Management 38 ◦ Control state ◦ Cookies ◦ Application state ◦ Profile properties

View state, control state, hidden fields, cookies, and query strings all involve storing data on the client in various ways. However, application state, session state, and profile properties all store data in memory on the server. State Management 39

Client-Based State Management Options The following are options for state management that involve storing information either in the page or on the client computer. For these options, no information is maintained on the server between round trips. View State Hidden Fields Query Strings State Management40  Control State  Cookies

Server-Based State Management Options With server-based state management, you can decrease the amount of information sent to the client in order to preserve state, however it can use costly resources on the server. The following are three server-based state management features Application State Session State State Management 41  Profile Properties

Contact For Tutorial and Notes Cikguhadi.com or PB LMS Digital Media Department