Power ASP.NET AJAX Programming. Agenda Partial-page rendering –With UpdatePanel –Without UpdatePanel PageRequestManager Drag-and-drop user interfaces.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Advertisements

Module 1: Creating Responsive Pages with Ajax Creating Partial-Page Updates by Using AJAX Scripting Actions on the Web Client.
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.
Current Popular IT I Pertemuan 4 Matakuliah: T0403/Current Popular IT I Tahun: 2008.
Satisfy Your Technical Curiosity The ASP.NET AJAX Extensions Jeff Prosise Cofounder, Wintellect
AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Web-Based Applications
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
1 JavaScript & AJAX CS , Spring JavaScript.
The Microsoft Technical Roadshow 2006 A Web-enabled Experience with Altas Mike Ormond Developer & Platform Evangelism Group, Microsoft Ltd
Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
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.
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
XForms: A case study Rajiv Shivane & Pavitar Singh.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Inside the Microsoft AJAX Library - AJAX and JavaScript ( AJAX acronym: Asynchronous JavaScript and XML) - new object-oriented features - modified XMLHttpRequest.
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.
Introduce What is ASP.NET AJAX Architecture of ASP.NET AJAX
The Microsoft AJAX Library Jeff Prosise Cofounder, Wintellect
Building rich web applications with the ‘Atlas’ framework Mike Ormond Developer & Platform Evangelism Group, Microsoft Ltd Developer & Platform Evangelism.
Building a UI with Zen Pat McGibbon –Sales Engineer.
AJAX in ASP.NET James Crowley Developer Fusion
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.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Web Applications meets Life Microsoft ASP.NET “Atlas” Saurabh Verma Chief Software Architect | The Perfect Future
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Real-World AJAX Seminar - March 13, 2006 Bringing the Richness and Responsiveness of Desktop Applications to the Web Sahil Malik telerik.
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.
WEB428 ASP.NET 2.0: Advanced Server Controls and Web Parts with ASP.NET 2.0 Andres Sanabria Program Manager Web Platform and Tools Team Microsoft Corporation.
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.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
Building AJAX-Enabled Applications with ASP.NET AJAX Framework Peter Ty Developer Evangelist Microsoft Hong Kong
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Ajax VS Flex A comparison based on shopping cart implementation PoHsu Yeh py2157.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
IT533 Lectures ASP.NET AJAX.
AJAX. Overview of Ajax Ajax is not an API or a programming language Ajax aims to provide more responsive web applications In normal request/response HTTP.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
It’s World Wide! I NTRODUCTION TO T HE WEB 1 Photo courtesy:
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
ASP.Net ICallback Vijayalakshmi G M Senior Trainer Binary Spectrum.
Name Title Microsoft Corporation
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
The Microsoft Technical Roadshow 2007 AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd
Introduction to Silverlight Development Pavel Yosifovich CTO, Matrix Global; Senior Instructor, Hi-Tech College
ASP.NET AJAX Fedorov Sergey, student of Computing Mathematic and Cybernetics faculty, software department, NNGU
Building rich web applications with ASP.NET AJAX Mike Ormond Developer & Platform Evangelism Group, Microsoft Ltd Developer & Platform Evangelism Group,
Optimizing and Extending ASP.NET AJAX Stefan Schackow Program Manager.
JavaScript and Ajax (Ajax Tutorial)
ASP.NET AJAX – Basics Svetlin Nakov Telerik Corporation
Working with Client-Side Scripting
XMLHttp Object.
AJAX.
Jim Fawcett CSE686 – Internet Programming Summer 2008
Presentation transcript:

Power ASP.NET AJAX Programming

Agenda Partial-page rendering –With UpdatePanel –Without UpdatePanel PageRequestManager Drag-and-drop user interfaces Client-side animations

Partial-Page Rendering Browser Web Server Browser submits HTTP request to server 1 Server responds with content; browser renders that content 2 Browser submits async XML- HTTP request to server; UI remains responsive; page doesn't flash 3 XML-HTTP request completes; JavaScript refreshes portion of page affected by response 4

UpdatePanel Partial-page rendering in a box –Automatically converts postbacks into async callbacks –Automatically updates content using callback results –Requires no knowledge of JavaScript or XmlHttpRequest High-level abstraction of XmlHttpRequest –Upside: Extremely easy to use, widely applicable –Downside: Less efficient than classic AJAX Exemplifies value added by AJAX frameworks

Script-Callable Web Service [System.Web.Script.Services.ScriptService] public class ZipCodeService : System.Web.Services.WebService { [System.Web.Services.WebMethod] public string[] GetCityAndState (string zip) {... }

Declaring a Service Reference

Calling a Web Service ZipCodeService.GetCityAndState("98052", onCompleted);. function onCompleted (result) { window.alert(result); }

Partial-Page Rendering

Microsoft AJAX Library Scripts MicrosoftAjaxTimer.js MicrosoftAjax- WebForms.js MicrosoftAjax- WebForms.js PreviewScript.js PreviewGlitz.js PreviewDragDrop.js MicrosoftAjax.js Partial-page rendering Base Class Library (controls, XML script, etc.) UI enhancements (animation and opacity) Drag-and-drop Script Core Library (run-time + framework) 15K 7K Sys.UI._Timer class Internet Explorer Internet Explorer Firefox Safari Other

MicrosoftAjaxWebForms.js Partial-page rendering support –Sys.WebForms namespace PageRequestManager class –Client-side counterpart to UpdatePanel –Manages async callbacks used for partial-page rendering and performs content updates using results –Client-side OM enables advanced UpdatePanel customizations not possible from server side _UpdateProgress class

PageRequestManager Methods Provide programmatic control over client-side PageRequestManager

PageRequestManager Events PageRequestManager fires client-side events Hook events on client for advanced customizations

Canceling Asynchronous Updates <asp:Button ID="CancelButton" Runat="server" Text="Cancel" OnClientClick="cancelUpdate(); return false" />. function cancelUpdate() { var obj = Sys.WebForms.PageRequestManager.getInstance(); if (obj.get_isInAsyncPostBack()) obj.abortPostBack(); }

Update Highlighting

PreviewDragDrop.js Adds drag-drop support to BCL –Sys.Preview.UI namespace _DragDropManager provides core support –Global instance named DragDropManager IDropSource and IDropTarget interfaces define signatures for drop-source and drop-target classes DragDropList and DraggableListItem provide canned implementation of reorderable lists FloatingBehavior provides generic mechanism for floating images, DIVs, and other entities

Floating an Image... function pageLoad() { var float = new Sys.Preview.UI.FloatingBehavior ($get('FloatMe')); float.set_handle($get('FloatMe')); float.initialize(); }

Drag-and-Drop PreviewScript.js includes drag-drop types –Sys.Preview.UI namespace _DragDropManager provides core support –Global instance named DragDropManager IDropSource and IDropTarget interfaces define signatures for drop-source and drop-target classes DragDropList and DraggableListItem provide canned implementation of reorderable lists FloatingBehavior provides generic mechanism for floating images, DIVs, and other entities

Implementing IDragSource Custom.UI.MyDragSourceBehavior = function(element) { Custom.UI.MyDragSourceBehavior.initializeBase(this, [element]); this._mouseDownHandler = Function.createDelegate(this, this.mouseDownHandler);... } Custom.UI.MyDragSourceBehavior.prototype = { // IDragSource methods get_dragDataType: function() {... }, getDragData: function(context) {... }, get_dragMode: function() {... }, onDragStart: function() {... }, onDrag: function() {... }, onDragEnd: function(canceled) {... }, // Other methods initialize: function() {... }, mouseDownHandler: function(ev) {... }, dispose: function() {... }, } Custom.UI.MyDragSourceBehavior.registerClass('Custom.UI.MyDragSourceBehavior', Sys.UI.Behavior, Sys.Preview.UI.IDragSource);

Implementing IDropTarget Custom.UI.MyDropTargetBehavior = function(element) { Custom.UI.MyDropTargetBehavior.initializeBase(this, [element]);... } Custom.UI.MyDropTargetBehavior.prototype = { // IDropTarget methods get_dropTargetElement: function() {... } canDrop: function(dragMode, dataType, data) {... } drop : function(dragMode, dataType, data) {... } onDragEnterTarget : function(dragMode, dataType, data) {... } onDragLeaveTarget : function(dragMode, dataType, data) {... } onDragInTarget : function(dragMode, dataType, data) {... } // Other methods initialize: function() {... } dispose: function() {... } } Custom.UI.MyDropTargetBehavior.registerClass('Custom.UI.MyDropTargetBehavior', Sys.UI.Behavior, Sys.Preview.UI.IDropTarget);

Using DragDropManager Call DragDropManager.registerDropTarget to register a drop target –Typically done in drop target's initialize method Call DragDropManager.startDragDrop to begin a drag-drop operation –Typically done in drag source's mouse-down handler Call DragDropManager.unregisterDropTarget to unregister drop target –Typically done in drop target's dispose method

Drag-and-Drop

PreviewGlitz.js Adds UI enhancements to BCL –Sys.Preview.UI.Effects namespace OpacityBehavior class wraps opacity of elements LayoutBehavior class wraps layout (size and pos) Animation and derivatives support animations Property- Animation Property- Animation Interpolated- Animation Interpolated- Animation Discrete- Animation Discrete- Animation Number- Animation Number- Animation Length- Animation Length- Animation Composite- Animation Composite- Animation Fade- Animation Fade- Animation

Fading In an Image... function pageLoad() { var image = new Sys.Preview.UI.Image ($get('SplashImage')); var fade = new Sys.Preview.UI.Effects.FadeAnimation(); fade.set_target(image); fade.set_effect (Sys.Preview.UI.Effects.FadeEffect.FadeIn); fade.set_duration(3); fade.set_fps(20); fade.play(); }

Animations

Discussion