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

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

22 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

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

25 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 default.aspx HTML and DHTML Reference us/library/ms aspx Extending JavaScript with ASP.NET AJAX utorials/EnhancingJavaScriptTutorial.aspx

29 Referenzen Classes in Jscript - Part I 24/classes-in-jscript-part-i.aspx Classes in JScript – Part II: Instance Properties / Methods & Class Properties / Methods 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 31/classes-in-jscript-part-iii-class-hierarchy- and-data-encapsulation.aspx Prototype-based programming based_programming

31 Referenzen XML Documentation Comments (C# Programming Guide) us/library/b2s063f7.aspx The format for JavaScript doc comments 23/the-format-for-javascript-doc- comments.aspx AjaxDoc

32 Referenzen Ajax Design Patterns RESTwiki bin/wiki.pl?FrontPage Remote Procedure Calls (RPC) Microsoft AJAX Library Cheat Sheets at_sheets_batch2.aspx

33 Referenzen IE + JavaScript Performance Recommendations aspx -javascript-performance-recommendations- part-2-javascript-code-inefficiencies.aspx -jscript-performance-recommendations-part-3- javascript-code-inefficiencies.aspx

34 Referenzen Yahoo developer network: Best Practices for Speeding Up Your Web Site html

35 Referenzen Fiddler Web Development Helper per.aspx Firebug

36 Visual Studio – weitere Angebote 90-Tage Evaluierungs Versionen aller VS2008 Editionen Launchveranstaltung von VS2008, SQL2008 & WS Februar 2008 in Frankfurt a.M. Visual Studio Team System Information Day Regelmäßige ganztägige Informationsveranstaltung von Microsoft Praxisnahe Demos & viel Raum für Diskussionen Details & Anmeldung: TeamConf 2008 – Die Visual Studio Team System Konferenz Save the Date! April 2008 in München Erste Informationen und Call for Papers: Patterns & Practices VSTS Guidance Project Praktische Ratschläge über den Einsatz von VSTS

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