IT533 Lectures ASP.NET AJAX.

Slides:



Advertisements
Similar presentations
Module 1: Creating Responsive Pages with Ajax Creating Partial-Page Updates by Using AJAX Scripting Actions on the Web Client.
Advertisements

ASP.NET Ajax Supplementary Tutorial. Why Use ASP.NET AJAX? - I ASP.NET AJAX enables you to build rich Web applications that have many advantages over.
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?
JustinMind: Dynamic Panels
Microsoft Expression Web-Illustrated Unit J: Creating Forms.
IT533 Lecture ASP.NET Controls. Installations Microsoft® SQL Server® 2008 Express.
© by Pearson Education, Inc. All Rights Reserved.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
1 of 6 Parts of Your Notebook Below is a graphic overview of the different parts of a OneNote 2007 notebook. Microsoft ® OneNote ® 2007 notebooks are digital.
Using the File Manager WebCT 6. Understanding File Manager The File Manager is the area where all course files are stored. Whenever you link a file in.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
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.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
ASP.NET AJAX. Content ASP.NET AJAX Ajax Control Toolkit Muzaffer DOĞAN - Anadolu University2.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Lesson 13: Building Web Forms Introduction to Adobe Dreamweaver CS6 Adobe Certified Associate: Web Communication using Adobe Dreamweaver CS6.
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.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
 2008 Pearson Education, Inc. All rights reserved Ajax-Enabled Rich Internet Applications.
ASP.NET AJAX 1. Ordinary web applications vs. AJAX Ordinary web application The full page is updated at each request The page is not available while being.
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.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
LATTICE TECHNOLOGY, INC. For Version 3.0 and later iXVL Publisher Tutorial For Version 3.0 and later.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introducing Web Controls Outline 29.1 Analyzing the.
IE 411/511: Visual Programming for Industrial Applications
Creating a Web Site to Gather Data and Conduct Research.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Rehab AlFallaj. Ajax Control Toolkit Add Ajax functionality to your ASP.NET Web Forms applications without writing JavaScript Add Ajax functionality to.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
CSCI 6962: Server-side Design and Programming AJAX Tools in JSF and ASP.
Creating Buttons – Lesson 51 Creating Buttons Lesson 5.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
BIT 285: ( Web) Application Programming Lecture 18: Thursday, March 5, 2015 REST Creating a REST API Instructor: Craig Duckett.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
1 HTML Forms
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
FrontPage Tutorial Part 2 Creating a Course Web Site.
Introduction to JavaScript CS101 Introduction to Computing.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
XP Browser and Basics COM111 Introduction to Computer Applications.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
January 2006Colby College ITS Setting Up Course Pages.
XP New Perspectives on Microsoft Windows XP Tutorial 5 1 Microsoft Windows XP Bringing the World Wide Web to the Desktop Tutorial 5.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
1 CS 3870/CS 5870: Note 19 AJAX Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
 2009 Pearson Education, Inc. All rights reserved.
ASP.NET Forms.
ASP.NET AJAX – Basics Svetlin Nakov Telerik Corporation
Chapter 2 – Introduction to the Visual Studio .NET IDE
ASP.NET Web Controls.
Unit 27 - Web Server Scripting
AJAX Rehab AlFallaj.
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

IT533 Lectures ASP.NET AJAX

Traditional Web Applications Figure below presents the typical interactions between the client and the server in a traditional web application.

3 The user first fills in the form ’ s fields, then submits the form (Step 1). The browser generates a request to the server, which receives the request and processes it (Step 2). The server generates and sends a response containing the page that the browser renders (Step 3). The browser to loads the new page (Step 4) and temporarily makes the browser window blank. While such a synchronous request is being processed on the server, the user cannot interact with the web page. If the user interacts with and submits another form, the process begins again (Steps 5 – 8). ASP.NET AJAX

Ajax Web Applications Ajax web applications add a layer between the client and the server to manage communication between the two.

5 When the user interacts with the page, the client requests information from the server (Step 1). The request is intercepted by the ASP.NET AJAX controls and sent to the server as an asynchronous request (Step 2) The user can continue interacting with the application in the client browser while the server processes the request. Other user interactions could result in additional requests to the server (Steps 3 and 4). ASP.NET AJAX

6 Once the server responds to the original request (Step 5), the ASP.NET AJAX control calls a client-side function to process the data returned by the server. This function — known as a callback function — uses partial-page updates (Step 6) to display the data without reloading the entire page. At the same time, the server may be responding to the second request (Step 7) and the client browser may be starting another partial-page update (Step 8). ASP.NET AJAX

7 The callback function updates only a designated part of the page. Such partial-page updates help make web applications more responsive, making them feel more like desktop applications. The web application does not load a new page while the user interacts with it. ASP.NET AJAX

8 Examining an ASP.NET AJAX Application The AJAX Extensions package that implements basic Ajax functionality comes preinstalled in Visual Studio. There is a tab of basic AJAX Extensions controls in the Toolbox. Microsoft also provides the ASP.NET AJAX Control Toolkit, which contains rich, Ajax-enabled GUI controls, which you can download.ASP.NET AJAX Control Toolkit ASP.NET AJAX

To add the controls to the Toolbox in Visual Web Developer: Right click the Toolbox and choose Add Tab. Type AJAX Control Toolkit as the name of the new tab. Right click the tab and select Choose Items. Click Browse... and select AjaxControlToolkit.dll from the folder. Finally, click OK, and a list of available Ajax controls will appear under the AJAX Control Toolkit tab when you are in Design mode. ASP.NET AJAX

To demonstrate ASP.NET AJAX capabilities we’ll enhance the Validation application we did before. The only significant modifications to this application appear in its ASPX file. We’ll use Ajax-enabled controls to add Ajax features to this application.

Outline a) The user enters his or her first and last name and proceeds to the Contact tab. b) The user enters an address in an incorrect format and presses Tab to move to the next input field. A callout appears informing the user to enter an address in a valid format. Fig. 1 | Validation application enhanced by ASP.NET AJAX. (Part 9 of 10.) Validation.aspx (9 of 10)

Outline c) After the user fills out the form properly and clicks the Submit button, the submitted data is displayed at the bottom of the page with a partial-page update. Fig. 1 | Validation application enhanced by ASP.NET AJAX. (Part 10 of 10.) Validation.aspx (10 of 10)

Outline Validation.aspx (1 of 10) To demonstrate ASP.NET AJAX capabilities we’ll enhance the Validation application we did before. The only significant modifications to this application appear in its ASPX file. We’ll use Ajax-enabled controls to add Ajax features to this application. Figure below is a modified Validation.aspx file that enhances the application by using several ASP.NET AJAX controls. Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 1 of 10.) Associate the AjaxControlToolkit assembly with a tag prefix, allowing us to use AJAX Control Toolkit elements.

Outline Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 2 of 10.) Validation.aspx (2 of 10) Load the ToolkitScriptManager on the page.

Outline Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 3 of 10.) Validation.aspx (3 of 10)

Outline Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 4 of 10.) Validation.aspx (4 of 10) ValidatorCalloutExtender controls display error messages in small yellow callouts next to the input fields.

Outline Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 5 of 10.) Validation.aspx (5 of 10)

Outline Fig.1 | Validation application enhanced by ASP.NET AJAX. (Part 6 of 10.) Validation.aspx (6 of 10)

Outline Fig. 1 | Validation application enhanced by ASP.NET AJAX. (Part 7 of 10.) Validation.aspx (7 of 10)

Outline Fig. 1 | Validation application enhanced by ASP.NET AJAX. (Part 8 of 10.) Validation.aspx (8 of 10)

ToolkitScriptManager Control The ToolkitScriptManager control manages the client- side scripts that enable asynchronous Ajax functionality. There can be only one ToolkitScriptManager per page. To incorporate controls from the AJAX Control Toolkit, use the ToolkitScriptManager, which derives from ScriptManager, instead. Drag the ToolkitScriptManager from the AJAX Control Toolkit tab in the Toolbox to the top of the page. A script manager must appear before any controls that use the scripts it manages. ASP.NET AJAX

Common Programming Error 22.1 Putting more than one instance of the ScriptManager control on a Web Form causes the application to throw an InvalidOperationException when the page is initialized.

Grouping Information in Tabs Using the TabContainer Control The TabContainer control enables you to group information into tabs that are displayed only if they are selected. To create multiple tabs, drag the TabContainer control from the AJAX Control Toolkit tab in the Toolbox to your form. To add a tab, open the TabContainer Tasks smart-tag menu and select Add Tab Panel. This adds a TabPanel object to the TabContainer. ASP.NET AJAX

In Design view, you can navigate between tabs by holding Ctrl and clicking the tab header, and you can drag and drop elements into the tab. The content of a TabPanel must be defined inside its ContentTemplate element. ASP.NET AJAX

Partial-Page Updates Using the UpdatePanel Control The UpdatePanel control eliminates full-page refreshes by isolating a section of a page for a partial-page update. To implement a partial-page update, drag the UpdatePanel into your form, and place controls to be updated inside it. To specify when an UpdatePanel should update, you need to define an UpdatePanel trigger. ASP.NET AJAX

Click the ellipsis button next to the control’s Triggers property in the Properties window. In the UpdatePanelTrigger Collection Editor dialog that appears, click Add to add an AsyncPostBackTrigger. ASP.NET AJAX Set the ControlID property and the EventName property to the desired trigger.

Adding Ajax Functionality to ASP.NET Validation Controls Using Ajax Extenders Several controls in the Ajax Control Toolkit are extenders— components that enhance regular ASP.NET controls. ValidatorCalloutExtender controls display error messages in small yellow callouts next to the input fields. To create a ValidatorCalloutExtender, you can drag and drop it, or you can select the Add Extender option in a validator’s smart-tag menu. In the Extender Wizard dialog that displays, choose ValidatorCalloutExtender, specify its ID, and click OK. ASP.NET AJAX

Fig. Creating a control extender using the Extender Wizard.

ValidatorCalloutExtender ’ s TargetControlID property indicates the validator control from which the extender should obtain the error message. This is automatically determined if you created the extender through the Extender Wizard. The ValidatorCalloutExtender s display error messages with a nicer look-and-feel. ASP.NET AJAX