developing rich internet applications using ajax and...

42
Developing Rich Internet Applications using AJAX and Atlas Adnan Farooq Hashmi MVP – Windows SDK User Group Leader, Core.NET Speaker – INETA Pakistan www.pkblogs.com/coredotnet

Upload: others

Post on 30-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Developing Rich Internet Applications

using AJAX and Atlas

Adnan Farooq HashmiMVP –Windows SDKUser Group Leader, Core.NETSpeaker – INETA Pakistan www.pkblogs.com/coredotnet

Page 2: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Participation

VideoODEO Convergence

MINT

SIXDEGREES

SKYPE JABBER

ITUNES

GTALK

VIDEOCASTING

The Buzzzzzz

Web2.0Economy

Usability

Design

StandardizationRemixability

Focus on Simplicity

MicroformatsWeb Standards

CSS-Design

Joy of UseAJAX

The Long Tail

Affilication

WikisFolksonomy

RecommendationSocial Software

Blogs

Audio

MobilityRSS OpenAPIs

DataDriven

COLLABORATION WIDGETS

SHARINGPAGERBANK

USER CENTEREDPERPETUAL BETA

LIVELINESS

TRUST

FOAF

XFNVCAGGREGATION

IMPODCASTING

DATA INSIDE SEOGRANULARITY MODULARITY SIMPLICITY

SEMANTICXHTML ACCESSIBILITY

WIFIUMTSXML

SYNDICATIONSOAP REST RUBYONTAILS

COSTPERCLICK

TAGTAGGERTAGGLING CLOUDALICIOUS

TAGCLOUDFLOCK DELICIOUS

FLICKRSTUMBLEUPON

DIGG SQUIDOOEBAY

43THINGSNINGSOFLOW LINKEDIN

OPENBC ORKUTUPCOMING FRIENDSTERPLANZO BLOGGER

TYPEPADWORDPRESS TECHNORATI

MEASUREMAPREAD.IOLASTFMIPODDER

BIT TORRENT

CREATIVECOMMONS

VIMEOYOUTUBE

CASTPOST

GOOGLE MAPSA9 PLAZES

YAHOO MAPSTAGCLOUD

BLOGLINESNEWSGATORFEEDSTER

FEEDBURNERMYYAHOO

ROJO

AMAZONGOOGLE MAPS

GMAPS MASHUPS TECHNORATIGOOGLE NEWSBUZZTRACKER GOOGLE A9 ICEROCKETINORDER WINK

ROLLYOTREADMAPPER

PUBSUB

BASECAMP

CHALK.ITBACKPACK

REMEMBERTHEMILKTADALIST

GTD GMAILGOOGLE MAPS KIKOGOOGLE

RSSREADER GOOGLE IG UNWIELDYZIMBRA MEEBO

PROTOPAGEZOOZIO

NETVIBESLIVE.COM

FLICKRFOTOLIABLINKSALE ETSY

EBAYAMAZON MTURK

ITUNES

ADSENSE

SIMPLEBITS

STYLEGALA

CSSBEAUTY9RULES

ZENGARDEN

WASPALISTAPART

FIREFOX

MICROFORMATS.ORG

Page 3: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Web 2.0

Term coined in late 2004Rich User ExperienceProgrammability• The Web as a Platform• Offering content as services and APIs and not just web pages

Page 4: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

User Experience (UX)

ResponsivenessInteractivityPersonalizationConnectedImmersive

Page 5: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

AJAX

“Asynchronous JavaScript and XML”Term coined in April 2005Applied to web applicationsAn approach to communicate with back‐end web services

Page 6: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

AJAX

Allows asynchronous communication with server without refreshing whole pageUses JSON & REST for communication

Page 7: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

AJAX

CSS for StylesJavaScript for Behavior}DHTML

Page 8: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

AJAX – XmlHttp

Originally developed by MicrosoftActiveX control inside IESend and receive data as XML (POX/REST), JSON, or plain textCan be used in any scripting language

open ( method, URL )send ( content )

Page 9: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

JSON

Abbr. for JavaScript Object NotationLightweight protocol used in AJAX communicationMore lightweight then XML

Page 10: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

JSON Example

class Conference{

string Title;string Venue;

}

<?xml version="1.0" ?><Conference>

<Title>PDC 2006</Title><Venue>Pearl Continental</Venue>

</Conference>

{ “Conference” {“Title”: “PDC 2006”,“Venue”: “Pearl Continental”}

}

Page 11: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Atlas

A framework for building  a newgeneration of richer, more interactive

highly personalized,standards basedweb applications

Page 12: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Atlas

NaukriWithoutAtlas.NETNaukriAtlas.NET

Page 13: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Developing with Atlas

Atlas Programming Model

Server-Centric Client-Centric

Update Panel

Control Extenders

JavaScript XML Script

Page 14: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Atlas – Server Centric

NaukriAtlas.NET

UI + Behavior

Input Data

Pages

UI Behavior (Managed Code)

Browser

Server Application

Presentation (HTML/CSS)

Page 15: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Atlas – Client Centric

NaukriAtlas.NET

a) Initia

l Renderin

g

(UI + Behavior)

Pages

UI Behavior (Managed Code)

Server Application

Browser

Presentation (HTML/CSS)

b) Data

c) Data

Page 16: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Server v/s Client Centric

Server Centric Web Apps• Work with existing Server Application Model• Keep core UI/application logic on server• Improve latency, interactivity, personalization

Client Centric Browser Apps• Fully exploit DHTML in presentation tier• Use AJAX for data, services, composition• Enable new immersive experience

Page 17: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

A couple of examples

Hotmail LiveLive.comPageflakes.comGoogle.com/igGoogle Spreadsheets

Page 18: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Getting Started with Microsoft Atlas

Page 19: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan
Page 20: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Select Project Template

Enter Project Name

Page 21: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Added by default

Page 22: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

<atlas: ScriptManager />

Added to .aspx file(s)Atlas Script Manager• Server Control to handle all script callbacks• Allows developers to specify 

• Script files to Include in the webpage• Web Services to Consume

Page 23: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Script Manager

<!–- Simple Syntax --><atlas:ScriptManager

ID=“ScriptManager1”runat=“server”EnablePartialRendering=“true” />

Allows Incremental Loading

Page 24: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Script Manager

<!–- Scripts & Services --><atlas:ScriptManager … ><Scripts>…

</Scripts><Services>

…</Services>

</atlas:ScriptManager>

JavaScript to add

Web Services to consume

Page 25: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Script Manager

<!–- Including External Scripts --><atlas:ScriptManager ID=“…” runat=“server”><Scripts>

<atlas:ScriptReference Name=“…” />

<atlas:ScriptReference Path=“xyz.js” />

</Scripts></atlas:ScriptManager>

Page 26: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Script Manager

<!–- Consuming Web Services --><atlas:ScriptManager ID=“…” runat=“server”><Services>

<atlas:ServiceReferencePath=“MyService.asmx” />

</Services></atlas:ScriptManager>

Page 27: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Server‐Centric Development with “Atlas” and ASP.NET

Page 28: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Server Controls

Update PanelControl Extenders• Drap‐and‐drop• Popups• Auto‐complete• Cascading dropdown lists [Country‐City]

Page 29: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Server Controls

Easy‐to‐use in ASP.NET• Application UI and core logic still runs on server• No need to master JavaScript and Asynchronous programming

AJAX‐enable existing ASP.NET sites

Page 30: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Server Controls

Uses AJAX in the background to reduce full roundtrips• Incremental UI updates• Examples: data navigation and editing, form validation, auto refresh

Page 31: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Server Controls

<atlas:Update Panel … />• Easily define updatable regions of a page• Server roundtrips become asynchronous• “Atlas” handles all infrastructure

Page 32: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

“Atlas” Update Panel

<atlas:UpdatePanel ID=“…” runat=“server”><ContentTemplate>

<!-- This content can be dynamically updated! -><asp:Calendar ID=“cal1” runat=“server”/>

</ContentTemplate></atlas:UpdatePanel>

Page 33: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Update Panel

Page 34: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Client‐Centric Development with “Atlas”

Page 35: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Client‐Centric Development

Page UI loads only onceData communicated between server and browser kept to a minimumHighly responsiveUI logic created using JavaScript 

Page 36: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Client‐Centric Development

“Atlas”Script Framework

JavaScript (Programmatically)

XML-Script (Declaratively)

Page 37: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Client‐Centric Development

Page 38: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

More “Atlas” Server Controls

Atlas Client Libraries• Reusable piece of interactive functionality• Attached to HTML UI declaratively or in code• Examples

• Drag‐and‐drop• Popups• Auto‐complete

• Easily extensible

Page 39: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Atlas Control Extenders

Included inside Atlas Control Toolkit• AtlasControlToolkit.dll• Microsoft.AtlasControlExtender.dll

Extend existing control’s functionality using pre‐developed DHTML

Page 40: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

More Demos…

Control ExtendersWeb PartsUI Glitz

if time permits…

Page 41: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan

Important URLs

http://www.pkblogs.com/coredotnethttp://atlas.asp.nethttp://www.programmableweb.comhttp://www.live.comhttp://www.pageflakes.comhttp://spreadsheets.google.com

Page 42: Developing Rich Internet Applications using AJAX and Atlasdownload.microsoft.com/download/6/f/9/6f941562-7e... · Developing Rich Internet Applications using AJAX and Atlas Adnan