Download presentation
Presentation is loading. Please wait.
Published byQuentin Gilbert Modified over 9 years ago
1
ASP.NET AJAX 1
2
Ordinary web applications vs. AJAX Ordinary web application The full page is updated at each request The page is not available while being updated AJAX A part of the page can be updated The page is available while being updated Better responsiveness Flicker-free More like ordinary Windows application Rich Internet Applications (RIA) 2ASP.NET AJAX
3
Some web sites using AJAX http://www.dr.dk/Sporte n/dongbold/ http://www.dr.dk/Sporte n/dongbold/ – Results of live sport events – Only parts of the page is updated http://www.google.com/ – Auto complete user input 3ASP.NET AJAX
4
AJAX general architecture AJAX means – Asynchronous JavaScript and XML Server generates – HTML – JavaScript Client-side AJAX engine sends – Request to Server side – Response is XML From web service Figure from www.openajax.org www.openajax.org 4ASP.NET AJAX
5
5
6
Some ASP.NET server side controls ScriptManager – Any ASP.NET page wishing to use AJAX must include a ScriptManagerControl UpdatePanel – A panel for partial-page update Timer – Makes post back at defined intervals – Used with UpdatePanel to perform periodic partial-page updates 6ASP.NET AJAX
7
ASP.NET AJAX client support Browser capability – Generates JavaScript for some browsers Internet Explorer, Firefox, Apple Safari Extends JavaScript – Classes, name spaces, data types, object serialization, etc. Network layer – Supports communication with web services 7ASP.NET AJAX
8
ASP.NET AJAX examples Partial-page update – AJAXORama: DataTimeUpdate.aspx – Example: AjaxLookUpCity Timer based partial-page update – AJAXORama: GroupChatAgain.asp 8ASP.NET AJAX
9
ASP.NET Web services Using AJAX you can call web service methods on the server side. Web services normally use HTTP for transportation – The payload is an XML document ASP.NET AJAX9
10
ASP.NET AJAX control kit Huge collection of controls – Most are JavaScript versions of ASP.NET server controls Not included in Microsoft Visual Studio Download from – http://www.asp.net/ajaxlibrary/act.ashx http://www.asp.net/ajaxlibrary/act.ashx Example components – AutoComplete Extends to TextBox Uses web services to list possible text entries, based on what’s already in the text box Example: AJAXORama: autoCompleteFromDatabase.aspx 10ASP.NET AJAX
11
References and further readings George Shepherd ASP.NET Step by Step, Microsoft Press 2010 – Chapter 23 AJAX, page 473-512 Imar Spaanjaars Beginning ASP.NET 4.0, Wrox 2010 – Chapter 10 ASP.NET AJAX, page 331-365 Bill Evjen Professional ASP.NET 4 in C# and VB, Wrox 2010 – Chapter 18 ASP.NET AJAX, page 709-745 – Chapter 19 ASP.NET AJAX Control Toolkit, page 747-803 AJAX: The Official Microsoft ASP.NET Site – http://www.asp.net/ajax http://www.asp.net/ajax 11ASP.NET AJAX
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.