Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASP.NET Ajax Daniel Walzenbach Developer Evangelist Microsoft Deutschland GmbH

Similar presentations


Presentation on theme: "ASP.NET Ajax Daniel Walzenbach Developer Evangelist Microsoft Deutschland GmbH"— Presentation transcript:

1 ASP.NET Ajax Daniel Walzenbach Developer Evangelist Microsoft Deutschland GmbH http://blogs.msdn.com/walzenbach

2 select * from Daniel document.getElementById('Daniel') $get('Daniel')

3 setting expectations

4 Was ist Ajax? Design Pattern Säulen von Ajax JavaScript Document Object Model (DOM) Cascading Style Sheets (CSS) XMLHttpRequest

5 AJAX Komponenten ASP.NET AJAX in Action, Manning Verlag, Seite 6

6 Ajax

7 Synchrone Webentwicklung ASP.NET AJAX in Action, Manning Verlag, Seite 8

8 Asynchrone Webentwicklung ASP.NET AJAX in Action, Manning Verlag, Seite 9

9 XMLHttpRequest

10 ASP.NET AJAX Architektur ASP.NET AJAX in Action, Manning Verlag, Seite 16

11 Microsoft Ajax Library Features Application Model Components JavaScript Extensions Compatibility Ajax Application Services Partial Rendering

12 Client Page Lifecycle ASP.NET AJAX in Action, Manning Verlag, Seite 44

13 tons of demos ;-)

14 Optimizing Symbolic Resolution Background: Javascript Variable Scoping LocalLocal GlobalGlobal DOMDOM ExpandoExpando

15 Optimizing Symbol Resolution Background: Evaluating local variables function WorkOnLocalVariable() { local_var = ObtainValueFromDOM(); return (local_var + 1); }

16 Optimizing Symbol Resolution Recommendation: Declare local variables function WorkOnLocalVariable() { var local_var = ObtainValueFromDOM(); return (local_var + 1); }

17 Optimizing Symbol Resolution Background: Recognize implicit look ups function BuildUI() { var baseElement=document.getElementById(target); baseElement.innerHTML = ; //Clear out previous baseElement.innerHTML += BuildTitle(); baseElement.innerHTML += BuildBody(); baseElement.innerHTML += BuildFooter(); }

18 Optimizing Symbol Resolution Recommendation: Cache values in local variables function BuildUI() { var elementText =BuildTitle() + BuildBody() + BuildFooter(); document.getElementById(target).innerHTML = elementText; }

19 Optimizing Symbol Resolution Background: DOM function symbolic lookup function CalculateSum() { var lSide = document.body.all.lSide.value; var rSide = document.body.all.rSide.value; document.body.all.result.value = lSide + rSide; }

20 Optimizing Symbol Resolution Recommendation: Cache values in local variables function CalculateSum() { // Cache document.body.all var elemCollection = document.body.all; var lSide = elemCollection.lSide.value; var rSide = elemCollection.rSide.value; elemCollection.result.value = lSide + rSide; }

21 Optimizing Symbol Resolution Background: Javascript function symbolic lookup function IterateWorkOverCollection() { var length = myCollection.getItemCount(); for(var index = 0; index { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3/918878/slides/slide_21.jpg", "name": "Optimizing Symbol Resolution Background: Javascript function symbolic lookup function IterateWorkOverCollection() { var length = myCollection.getItemCount(); for(var index = 0; index

22 Optimizing Symbol Resolution Recommendation: cache JavaScript function pointers function IterateWorkOverCollection() { var funcWork = Work; var length = myCollection.getItemCount(); for(var index = 0; index { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3/918878/slides/slide_22.jpg", "name": "Optimizing Symbol Resolution Recommendation: cache JavaScript function pointers function IterateWorkOverCollection() { var funcWork = Work; var length = myCollection.getItemCount(); for(var index = 0; index

23 Optimizing Symbol Resolution Background: Internet Explorer function symbolic lookup function IterateWorkOverCollection() { var parentElement = document.getElementById(target); var length = myCollection.getItemCount(); for(var index = 0; index { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3/918878/slides/slide_23.jpg", "name": "Optimizing Symbol Resolution Background: Internet Explorer function symbolic lookup function IterateWorkOverCollection() { var parentElement = document.getElementById(target); var length = myCollection.getItemCount(); for(var index = 0; index

24 Optimizing Symbol Resolution Recommendation: Cache Internet Explorer function pointers (sometimes) function IterateWorkOverCollection() { var funcAppendChild = document.getElementById(target).appendChild; var length = myCollection.getItemCount(); for(var index = 0; index { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3/918878/slides/slide_24.jpg", "name": "Optimizing Symbol Resolution Recommendation: Cache Internet Explorer function pointers (sometimes) function IterateWorkOverCollection() { var funcAppendChild = document.getElementById(target).appendChild; var length = myCollection.getItemCount(); for(var index = 0; index

25 Javascript Code Inefficiencies Background: String concatenation var smallerStrings = new Array(); var myRatherLargeString = ""; var length = smallerStrings.length; for(var index = 0; index { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/3/918878/slides/slide_25.jpg", "name": "Javascript Code Inefficiencies Background: String concatenation var smallerStrings = new Array(); var myRatherLargeString = ; var length = smallerStrings.length; for(var index = 0; index

26 Javascript Code Inefficiencies Recommendation: array.join for string concatenation var smallerStrings = new Array(); smallerStrings.push(" "); smallerStrings.push("sampleText"); smallerStrings.push(" "); … var myRatherLargeString = smallerStrings.join();

27 Referenzen ASP.NET Ajax in Action, Manning Verlag

28 Referenzen ASP.NET AJAX Online Documentation http://www.asp.net/AJAX/Documentation/Live/ default.aspx HTML and DHTML Reference http://msdn2.microsoft.com/en- us/library/ms533050.aspx Extending JavaScript with ASP.NET AJAX http://www.asp.net/AJAX/Documentation/Live/t utorials/EnhancingJavaScriptTutorial.aspx

29 Referenzen Classes in Jscript - Part I http://blogs.msdn.com/jscript/archive/2007/09/ 24/classes-in-jscript-part-i.aspx Classes in JScript – Part II: Instance Properties / Methods & Class Properties / Methods http://blogs.msdn.com/jscript/archive/2007/09/ 30/classes-in-jscript-part-ii-instance- properties-methods-class-properties- methods.aspx

30 Referenzen Classes in JScript – Part III: Class Hierarchy and Data Encapsulation http://blogs.msdn.com/jscript/archive/2007/10/ 31/classes-in-jscript-part-iii-class-hierarchy- and-data-encapsulation.aspx Prototype-based programming http://en.wikipedia.org/wiki/Prototype- based_programming

31 Referenzen XML Documentation Comments (C# Programming Guide) http://msdn2.microsoft.com/en- us/library/b2s063f7.aspx The format for JavaScript doc comments http://weblogs.asp.net/bleroy/archive/2007/04/ 23/the-format-for-javascript-doc- comments.aspx AjaxDoc http://www.codeplex.com/ajaxdoc

32 Referenzen Ajax Design Patterns http://ajaxpatterns.org/ RESTwiki http://rest.blueoxen.net/cgi- bin/wiki.pl?FrontPage Remote Procedure Calls (RPC) http://www.cs.cf.ac.uk/Dave/C/node33.html Microsoft AJAX Library Cheat Sheets http://aspnetresources.com/blog/ms_ajax_che at_sheets_batch2.aspx

33 Referenzen IE + JavaScript Performance Recommendations http://blogs.msdn.com/ie/archive/2006/08/28/7 28654.aspx http://blogs.msdn.com/ie/archive/2006/11/16/ie -javascript-performance-recommendations- part-2-javascript-code-inefficiencies.aspx http://blogs.msdn.com/ie/archive/2007/01/04/ie -jscript-performance-recommendations-part-3- javascript-code-inefficiencies.aspx

34 Referenzen Yahoo developer network: Best Practices for Speeding Up Your Web Site http://developer.yahoo.com/performance/rules. html

35 Referenzen Fiddler http://www.fiddlertool.com/fiddler/ Web Development Helper http://projects.nikhilk.net/Projects/WebDevHel per.aspx Firebug http://www.getfirebug.com/

36 Visual Studio – weitere Angebote 90-Tage Evaluierungs Versionen aller VS2008 Editionen www.msdn-online.de/evalcenter Launchveranstaltung von VS2008, SQL2008 & WS2008 19.-21. Februar 2008 in Frankfurt a.M. www.microsoftlaunch2008.de Visual Studio Team System Information Day Regelmäßige ganztägige Informationsveranstaltung von Microsoft Praxisnahe Demos & viel Raum für Diskussionen Details & Anmeldung: www.event-team.com/events/visualstudiowww.event-team.com/events/visualstudio TeamConf 2008 – Die Visual Studio Team System Konferenz Save the Date! 22.-24. April 2008 in München Erste Informationen und Call for Papers: www.teamconf.dewww.teamconf.de Patterns & Practices VSTS Guidance Project Praktische Ratschläge über den Einsatz von VSTS www.codeplex.com/VSTSGuidance

37 © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

38 © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

39 © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "ASP.NET Ajax Daniel Walzenbach Developer Evangelist Microsoft Deutschland GmbH"

Similar presentations


Ads by Google