Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax...

39
Simon Amrein Consultant Trivadis AG The 'J' in your browser: Jquery & aJax

Transcript of Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax...

Page 1: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Simon AmreinConsultantTrivadis AG

The 'J' in your browser: Jquery & aJax

Page 2: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

The 'J' in your browserAgenda

What isASP.NET 4.0 AjaxAjax Control ToolkitMicrosoft Ajax Content Delivery NetworkjQuery

jQuery Client Templates und DatabindingSummary & Resources

Page 3: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

‘J’ popularity

Ajax

But this is the football team...

Page 4: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Ajax c#

‘J’ popularity

Page 5: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

‘J’ popularity

Ajax control toolkit

Page 6: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

‘J’ popularity

jQuery

Page 7: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

The 'J' in your browserNot in the Agenda

ASP.NET Ajax LibraryThe Beta-Version was the lastversion. Microsoft is now supporting the jQuery Project

Page 8: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

ASP.NET 4.0 AjaxServer Controls

ScriptManager ControlThe ScriptManager control manages client script for AJAX-enabled ASP.NET Web pages.

UpdatePanel ControlEnable partial-page updates

UpdateProgress ControlTemplate to show that an asynchronus method is working

Timer Control

Page 9: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

ASP.NET 4.0 AjaxDemo

Page 10: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Ajax Control Toolkit (ACT)

The Ajax Control Toolkit contains a rich set of controls that you can use to build highly responsive and interactive Ajax-enabled Web applications.The Ajax Control Toolkit contains more than 40 controls

Page 11: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

AutoCompleteCollapsiblePanelColorPickerMaskedEditCalendarAccordionWatermark…

Ajax Control Toolkit (ACT)Controls

Page 12: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Visual Studio 2008 Ajax Control Toolkit for .NET 3.5.

Visual Studio 2010.NET 4 or .NET 3.5 versions of the ACT

Ajax Control Toolkit (ACT)Versions

Page 13: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Ajax Control ToolkitDemo

Page 14: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Microsoft Ajax Content Delivery Network (CDN)The Microsoft Ajax Content Delivery

Network (CDN) enables you to easily add popular JavaScript libraries such as jQuery to your Web applications. For example, you can start using jQuery simply by adding a <script> tag to your page that points to Ajax.microsoft.com.

http://www.asp.net/ajaxlibrary/CDN.ashx

Page 15: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

CDN – Why?

Improve the performance Ajax applications.

Contents of the Microsoft Ajax CDN are cached on servers located around the world.

Page 16: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

CDN – Include…

The Microsoft Ajax CDN includes:jQuery (owned by the jQuery Team)jQuery UI (owned by the jQuery UI)jQuery Validation (jQuery team)jQuery CycleAjax Control Toolkit (owned by the CodePlex)ASP.NET AjaxASP.NET MVC JavaScript Files

http://www.asp.net/ajaxLibrary/cdn.ashx

Page 17: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

CDNDemo

Page 18: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery (“$”)Basics

jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML

Used by over 31% of the 10,000 most visited websites

jQuery is the most popular JavaScript library in use today

Source: Wikipedia

Page 19: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

How to get jQuery

www.jquery.com

Compressed for productionUncompressed for developing / debugging

Page 20: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQueryBasics

ComponentsjQuery CoreSelectorsAttributesEvents

EffectsAjaxjQuery UI…

Page 21: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

All Selector (“*”) Selects all elements.Class Selector (“.class”) Elements with the given class. Element Selector (“element”) Selects all elements with the given tag name.ID Selector (“#id”) Element with the given id attribute.

jQueryBasic Selectors<div id="myDiv">

Some Content</div> <script> $("#myDiv").SomeThing()</script>

Page 22: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

.click()

.dblclick()

.mousedown()

jQueryJust a few Events

<div id="target"> Click here </div>

$('#target').click(function() {alert('Handler for .click() called.'); });

.mouseenter().mouseleave().mousemove()

.mouseout()…

Page 23: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

.show()

.hide()

.animate()

.fadeIn()

.fadeOut()

.slideUp()

.slideDown()…

jQuerySome Effects

$('#button').click(function() { $('#target').animate( { opacity: 0.25, left: '+=50', height: 'toggle' } , 5000 , function() { //Animation completed }); });

Page 24: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery – BasicsDemo

Page 25: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQueryClient Templates

jQuery templates contain markup with binding expressions. Templates are applied to data objects or arrays, and rendered into the HTML DOMAvailable as a plugin

The plugin requires jQuery version 1.4.2.Will be included in major release 1.5

http://api.jquery.com/tmpl/

Page 26: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery Client Templates<script id=“template" type="text/x-jquery-tmpl">

<li><b>${Name}</b> (${ReleaseYear})</li> </script><script type="text/javascript"> var employees = [ {Name:"Simon Amrein", Location: "Zurich"}, {Name:"Stefan Frutiger", Location: "Bern"}, {Name:"Meinrad Weiss", Location : "Zurich"}];

element $("#template").tmpl( movies ).appendTo( "#movieList" ); </script>

<ul id="movieList"></ul>

mew
:-)
Page 27: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery Client TemplatesDemo

Page 28: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQueryData-Linking

The link API allows you to very quickly and easily link fields of a form to an object. Any changes to the form fields are automatically pushed onto the objectConverters lets you modify the format or type of the value as it flows between the two sides This plugin currently depends on jQuery version 1.4.3

Page 29: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

var person = {};

$("form").link(person, { firstName: "first-name", lastName: "last-name", });

jQueryData Link

Page 30: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

var person = {}; $("#age").link(person, { age: { convert: function(value) { return Math.round(Math.parseFloat(value)); } } });

$("#name").val("7.5"); alert(person.age); // 8

jQueryData Link Converter

Page 31: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery – Data LinkDemo

Page 32: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery & MicrosoftOutlook

In March, the jQuery Community announced at MIX 2010 that Microsoft had committed to supporting the jQuery Project via code contributions and resources.Microsoft made available for public review their first jQuery plugin which provided client-side templating capabilities to the jQuery communityThe Microsoft-contributed plugins for version 1.5 – the jQuery Templates plugin, the jQuery Data Link plugin, and the jQuery Globalization plugin

Page 33: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

jQuery V 1.5

jQuery.require() will load a plugin2 only after plugin1

jQuery.forEach jQuery.exception (easy to hook into throw) And much more…

Page 34: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

The 'J' in your browserSummary

The ‘J’ stands for rich and interactive Web applications

Microsoft stopped investments for client scripts

But Ajax and jQuery will be the future

You don’t have to use it, but you will love it!

Page 36: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

SwissPDC10@TrivadisTermin: 28.10.2010Ort: Zürich - in der Trivadis Niederlassung Agenda:

16:00 h: Registrierung und Begrüssungskaffee 16:30 h: Silverlight, Azure and WP7 17:30 h: Pause mit Verpflegung18:00 h: Keynote PDC10 mit Steve Ballmer 20:00 h: Pause mit Verpflegung 20:30 h: Podiumsdiskussion: "Was bedeuten die Ankündigung für die Praxis" 21:30 h: Verlosung der Preise

Page 37: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

And now...

Remember www.jquery.com

After Q & A Go home and test it...

Page 38: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

Q&A

Page 39: Simon Amrein Consultant Trivadis AG What is ASP.NET 4.0 Ajax Ajax Control Toolkit Microsoft Ajax Content Delivery Network jQuery jQuery Client Templates.

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.