ASP.NET AJAX - 20090916

1,050 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,050
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
1
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

ASP.NET AJAX - 20090916

  1. 1. Date : 16 – 09- 2009ASP.NET AJAX Presenter : Viral Patel © Directi
  2. 2. Prerequisites AJAX : Asynchronous Javascript And XML  Without AJAX, GET/POST request is sent to server • which results in refreshing entire page  With AJAX, a javascript function calls a server script in background. • which results in refreshing specific region of a page • the background script returns response in XML* Advantages: • Improved and quick responsive user experience • Efficiency of web application
  3. 3. ASP.NET AJAX Framework Server Client Side Components Script Libraries AJAX jQuery Control Library Toolkit
  4. 4. PART - I : Server Components
  5. 5. Server Components • Script Support • Localization • Web Services • Application Services • Server Controls
  6. 6. Server Controls• ScriptManager• UpdatePanel• Control Extenders
  7. 7. Server Controls• ScriptManager • Manages ASP.NET AJAX script libraries and script files, partial-page rendering, and client proxy class generation for Web and application services. • The control manages all ASP.NET AJAX resources on a page• UpdatePanel • Enables sections of a page to be partially rendered without a postback. • They are used with the ScriptManager control to enable partial-page rendering.
  8. 8. Demo 1 : Server Controls Demo Contents  Use of ScriptManager, UpdatePanel  Changes in Source Code (with AJAX)  UpdateProgress
  9. 9. Partial-page rendering overview - ScriptManager server control - PageRequestManager class @ Clientwith an asynchronous postback, page updates are limited to regions of the page thatare enclosed in UpdatePanel controls and that are marked to be updated. The serversends HTML markup for only the affected elements to the browser. In the browser, theclient PageRequestManager class performs Document Object Model (DOM)manipulation to replace existing HTML with updated markup.
  10. 10. Partial Page Rendering• ScriptManager (1 & only 1 per page)• EnablePartialRendering = true (default) markup-enabled code-only public code markup properties properties methods descendants AllowCustomErrorsRedirect AuthenticationService SetFocus(string) <AuthenticationService> AsyncPostBackErrorMessage IsInAsyncPostBack <ProfileService> AsyncPostBackTimeout ProfileService <Scripts> EnableScriptGlobalization Scripts <asp:ScriptReference> EnableScriptLocalization Services <Services> ScriptLoadTimeout SupportsPartialRendering <asp:ServiceReference> ScriptMode IsDebuggingEnabled <CompositeScript> ScriptPath <RoleService>
  11. 11. Partial Page UpdateUpdatePanel (atleast 1 per page) markup-enabled code-only public code markup properties properties methods descendants ChildrenAsTriggers IsInPartialRendering Update() <ContentTemplate> UpdateMode ContentTemplate <Triggers> RenderMode ContentTemplateContainer <asp:AsyncPostBackTrigger> Triggers <asp:PostbackTrigger> Note: ChildrenAsTriggers cannot be set to false when UpdateMode is set to Always
  12. 12. Partial Page Update• Advantages – the state of your multimedia is unchanged, – bandwidth costs are reduced – the client does not experience the flicker usually associated with a postback.
  13. 13. Demo 2 : Partial Page Update Demo Contents  Properties of ScriptManager, UpdatePanel  ChildrenAsTriggers  UpdateMode  Triggers
  14. 14. PART - II : Client side Script Libraries
  15. 15. Client side Script Libraries • Sys.Application • PageRequestManager (DOM Manipulation) • Microsoft Ajax Library • Components • JavaScript components • Sys.Application • Javascript Extensions • Abstraction API • DOM traversal and manipulation automatically converted to browser-specific calls • Ajax • Application Services ASP.NET Membership, Authentication, Roles and Profile services from the client side.
  16. 16. Client Life-Cycle Events
  17. 17. Demo 3 : Client Life-Cycle Demo Contents  Sys.Application  PageRequestManager Class
  18. 18. Extending Javascript with ASP.NET AJAX• Classes• Namespaces• Inheritance• Interfaces• Enumerations• Reflection
  19. 19. Demo 4 : Multiple Asyc Postbacks  Demo Contents  Case of Multiple Asychronous Postbacks  How to handle Multiple Asychronous Postbacks ?
  20. 20. Demo 5 : Client-Side Callbacks Demo Contents  Calling a web service from client side
  21. 21. Demo 6 : History Management Demo Contents  How to manage history in asynchronous postbacks ?  How history states are stored ?
  22. 22. PART - III : AJAX Control Toolkit
  23. 23. AJAX Control Toolkit• ACT is shared-source community project• http://ajaxcontroltoolkit.codeplex.com• http://www.asp.net/ajax/ajaxcontroltoolkit/samples/
  24. 24. PART - IV : jQuery
  25. 25. jQuery Open Source JS Library Cross-Browser Compatible Will be Included with MS VS 2010 Currently comes as-is With ASP.NET MVC Installer Microsoft will support using Product Support Services MS will add Intellisense for jQuery MS will actively update jQuery
  26. 26. References AJAX Documentation – http://www.asp.net/ajax/documentation/ ASP.NET AJAX Overview: – http://msdn.microsoft.com/en-us/library/bb398874.aspx
  27. 27. Topics not included– Adding AJAX Functionality to ASP.NET Controls– http://msdn.microsoft.com/en-us/library/bb398782.aspx
  28. 28. Thank You !

×