SlideShare une entreprise Scribd logo
1  sur  17
Development of
Rich Internet Apps
with ASP.NET
Hrvoje Hudoletnjak
Agenda
Little bit of History
Knockout (Open Source)
Microsoft ASP.NET Web API (Open Source)
HTML5 (Open Source)
SignalR
Little bit of History
Then
HTML + CSS
Flash / Flex
Silverlight
Now
HTML5 / CSS3 / JavaScript
Future?
Native or plugin?
What is a Single Page App?
Server-Side App
Page rendered from the server
ASP.NET WebForms / MVC
SinglePage App
Page rendered from the browser
Only one actual page is loaded
ASP.NET REST API + Client side code
Why Single Page Apps?
The problem with server-side apps:
Server-Side Apps are Stateless
The Presentation Layer is Miles Away
Server-Side Apps don’t respect the web
Knockout
MVVM for JavaScript
Open-source framework created by Steven Sanderson
Included with ASP.NET MVC 4 (works with Web Forms)
Available through NuGet with:
Install-Package KnockoutJS
Knockout
Observer Pattern:
An object maintains a list of observers. When the object changes, the
observers are notified.
// Create view model
var viewModel = {
product: {
name: ko.observable("Milk"),
price: ko.observable(2.99)
},
updateProduct: function() {
alert(viewModel.product.name());
}
};
// Bind view model to DOM
ko.applyBindings(viewModel);
Name:
<input data-bind="value:product.name" />
Price:
<input data-bind="value:product.price" />
<button data-bind="click:updateProduct">
Update
</button>
Knockout two-way databinding
Javascrip
t
HTML
Server Client
Web UI
HTML/CSS/JS
Data services
JSON/XML
Application layer
JavaScript
Visible UI
HTML/CSS
Data access layer
JavaScript
Local storage
Navigation
APIs
MVC, WEBFORMS
KNOCKOUT
WEB API
BREEZE
HISTORY.JS
HTML5
What is the ASP.NET Web API?
ASP.NET MVC Controllers
return views (HTML)
derives from Controller base class
ASP.NET API Controllers
return data (JSON, XML)
derives from ApiController base class
uses POST, GET, PUT, DELETE
What is the ASP.NET Web API?
What is it Good For?
Public Web API
Twitter, Salesforce.com, StackOverflow
Single Page Apps (SPA)
A single view is rendered to the browser and all updates to the view are
made using jQuery with the Web API. No Postbacks!
Model Binding
Converts form post into a strongly typed C# class:
{ “id”: 23, “title”: “Star Wars”, “director”: “Lucas”}
Converts to:
new Movie { Id=23, Title=“Star Wars”, Director=“Lucas”}
Validation
You can use validation attributes with the Web API:
Required, StringLength, Range, and so on
Authorization
You can perform authorization declaratively by using the [Authorize]
attribute with API controller methods.
You can perform authorization imperatively by returning a 401 Unauthorized
status code.
Remember to enable Forms Authentication in the Web.config file.
HTML5
HTML5 (and related standards) adds support for:
Client-Side Validation – Input validation in the browser.
Web Storage – Store key value pairs in big, persistent cookies.
IndexedDB – Standard API for interacting with in-browser database (SQL
Compact, MySQL)
Web Sockets – Asynchronous communication with a two-way open socket.
Validation adds two new attributes: required, pattern
Supports custom validation with new JavaScript method:
setCustomValidity()
Web Sockets
Full duplex client-server communication
SignalR (Open Source)
WebSockets on IIS 8 + IE10/Chrome/Firefox
Fallback to AJAX polling duplex
public class Chat : Hub
{
public void Send(string message)
{
Clients.All.addMessage(message);
}
}
var chat = $.connection.chat;
chat.client.addMessage = function (message) {
$('#messages').append('<li>' + message +
'</li>');
};
$.connection.hub.start();
C# Javascrip
t
Thank you! Questions?
Hrvoje Hudoletnjak software developer, MVP for ASP.NET/IIS
http://hudosvibe.net
http://twitter.com/hhrvoje
hrvoje@hudoletnjak.com
Some slides by Stephen Walther from http://Superexpert.com

Contenu connexe

Tendances

ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008Caleb Jenkins
 
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)Chalermpon Areepong
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0Shiju Varghese
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines Dev Raj Gautam
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCKhaled Musaied
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training sessionHrichi Mohamed
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apisChalermpon Areepong
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC eldorina
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Introduction to azure web applications for office and share point developers
Introduction to azure web applications for office and share point developersIntroduction to azure web applications for office and share point developers
Introduction to azure web applications for office and share point developersJoAnna Cheshire
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)Hatem Hamad
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Thomas Robbins
 

Tendances (20)

ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apis
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Vaadin NYC Meetup
Vaadin NYC MeetupVaadin NYC Meetup
Vaadin NYC Meetup
 
No brainer
No brainerNo brainer
No brainer
 
Introduction to azure web applications for office and share point developers
Introduction to azure web applications for office and share point developersIntroduction to azure web applications for office and share point developers
Introduction to azure web applications for office and share point developers
 
Mvc
MvcMvc
Mvc
 
Ajax & ASP.NET 2
Ajax & ASP.NET 2Ajax & ASP.NET 2
Ajax & ASP.NET 2
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 

Similaire à RIA / SPA with ASP.NET

Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Againjonknapp
 
Websites, Web Services and Cloud Applications with Visual Studio
Websites, Web Services and Cloud Applications with Visual StudioWebsites, Web Services and Cloud Applications with Visual Studio
Websites, Web Services and Cloud Applications with Visual StudioMicrosoft Visual Studio
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
Migrating MVVM Applications to HTML5
Migrating MVVM Applications to HTML5Migrating MVVM Applications to HTML5
Migrating MVVM Applications to HTML5Chris Bannon
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
MCSD and 70-487 Exam Blueprint
MCSD and 70-487 Exam BlueprintMCSD and 70-487 Exam Blueprint
MCSD and 70-487 Exam BlueprintJeff Chu
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backboneRTigger
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016johannes_fiala
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Osconvijayrvr
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19Niit Care
 
Asp.net visual studio 2013
Asp.net   visual studio 2013Asp.net   visual studio 2013
Asp.net visual studio 2013Tyrone Moodley
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
I T Mentors V S2008 Onramp240 V1
I T Mentors  V S2008  Onramp240 V1I T Mentors  V S2008  Onramp240 V1
I T Mentors V S2008 Onramp240 V1llangit
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Quek Lilian
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0Buu Nguyen
 

Similaire à RIA / SPA with ASP.NET (20)

Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
Websites, Web Services and Cloud Applications with Visual Studio
Websites, Web Services and Cloud Applications with Visual StudioWebsites, Web Services and Cloud Applications with Visual Studio
Websites, Web Services and Cloud Applications with Visual Studio
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Migrating MVVM Applications to HTML5
Migrating MVVM Applications to HTML5Migrating MVVM Applications to HTML5
Migrating MVVM Applications to HTML5
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
MCSD and 70-487 Exam Blueprint
MCSD and 70-487 Exam BlueprintMCSD and 70-487 Exam Blueprint
MCSD and 70-487 Exam Blueprint
 
Give your web apps some backbone
Give your web apps some backboneGive your web apps some backbone
Give your web apps some backbone
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 
How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016How to generate a rest application - DevFest Vienna 2016
How to generate a rest application - DevFest Vienna 2016
 
Microsoft Tech Ed 2006 #1
Microsoft Tech Ed 2006 #1Microsoft Tech Ed 2006 #1
Microsoft Tech Ed 2006 #1
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
13 asp.net session19
13 asp.net session1913 asp.net session19
13 asp.net session19
 
ASP.pptx
ASP.pptxASP.pptx
ASP.pptx
 
Asp.net visual studio 2013
Asp.net   visual studio 2013Asp.net   visual studio 2013
Asp.net visual studio 2013
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
I T Mentors V S2008 Onramp240 V1
I T Mentors  V S2008  Onramp240 V1I T Mentors  V S2008  Onramp240 V1
I T Mentors V S2008 Onramp240 V1
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0
 

Plus de Hrvoje Hudoletnjak

Plus de Hrvoje Hudoletnjak (7)

Project K, Vnext and Owin
Project K, Vnext and OwinProject K, Vnext and Owin
Project K, Vnext and Owin
 
Owin katana en
Owin katana enOwin katana en
Owin katana en
 
EF6 and DDD
EF6 and DDDEF6 and DDD
EF6 and DDD
 
ATD9 2013 One ASP.NET
ATD9 2013 One ASP.NETATD9 2013 One ASP.NET
ATD9 2013 One ASP.NET
 
My weekend startup: seocrawler.co
My weekend startup: seocrawler.coMy weekend startup: seocrawler.co
My weekend startup: seocrawler.co
 
ASP.NET: Present and future
ASP.NET: Present and futureASP.NET: Present and future
ASP.NET: Present and future
 
Open source and .net
Open source and .netOpen source and .net
Open source and .net
 

Dernier

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Dernier (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

RIA / SPA with ASP.NET

  • 1. Development of Rich Internet Apps with ASP.NET Hrvoje Hudoletnjak
  • 2. Agenda Little bit of History Knockout (Open Source) Microsoft ASP.NET Web API (Open Source) HTML5 (Open Source) SignalR
  • 3. Little bit of History Then HTML + CSS Flash / Flex Silverlight Now HTML5 / CSS3 / JavaScript Future? Native or plugin?
  • 4. What is a Single Page App? Server-Side App Page rendered from the server ASP.NET WebForms / MVC SinglePage App Page rendered from the browser Only one actual page is loaded ASP.NET REST API + Client side code
  • 5. Why Single Page Apps? The problem with server-side apps: Server-Side Apps are Stateless The Presentation Layer is Miles Away Server-Side Apps don’t respect the web
  • 6. Knockout MVVM for JavaScript Open-source framework created by Steven Sanderson Included with ASP.NET MVC 4 (works with Web Forms) Available through NuGet with: Install-Package KnockoutJS
  • 7. Knockout Observer Pattern: An object maintains a list of observers. When the object changes, the observers are notified.
  • 8. // Create view model var viewModel = { product: { name: ko.observable("Milk"), price: ko.observable(2.99) }, updateProduct: function() { alert(viewModel.product.name()); } }; // Bind view model to DOM ko.applyBindings(viewModel); Name: <input data-bind="value:product.name" /> Price: <input data-bind="value:product.price" /> <button data-bind="click:updateProduct"> Update </button> Knockout two-way databinding Javascrip t HTML
  • 9. Server Client Web UI HTML/CSS/JS Data services JSON/XML Application layer JavaScript Visible UI HTML/CSS Data access layer JavaScript Local storage Navigation APIs MVC, WEBFORMS KNOCKOUT WEB API BREEZE HISTORY.JS HTML5
  • 10. What is the ASP.NET Web API? ASP.NET MVC Controllers return views (HTML) derives from Controller base class ASP.NET API Controllers return data (JSON, XML) derives from ApiController base class uses POST, GET, PUT, DELETE
  • 11. What is the ASP.NET Web API? What is it Good For? Public Web API Twitter, Salesforce.com, StackOverflow Single Page Apps (SPA) A single view is rendered to the browser and all updates to the view are made using jQuery with the Web API. No Postbacks!
  • 12. Model Binding Converts form post into a strongly typed C# class: { “id”: 23, “title”: “Star Wars”, “director”: “Lucas”} Converts to: new Movie { Id=23, Title=“Star Wars”, Director=“Lucas”}
  • 13. Validation You can use validation attributes with the Web API: Required, StringLength, Range, and so on
  • 14. Authorization You can perform authorization declaratively by using the [Authorize] attribute with API controller methods. You can perform authorization imperatively by returning a 401 Unauthorized status code. Remember to enable Forms Authentication in the Web.config file.
  • 15. HTML5 HTML5 (and related standards) adds support for: Client-Side Validation – Input validation in the browser. Web Storage – Store key value pairs in big, persistent cookies. IndexedDB – Standard API for interacting with in-browser database (SQL Compact, MySQL) Web Sockets – Asynchronous communication with a two-way open socket. Validation adds two new attributes: required, pattern Supports custom validation with new JavaScript method: setCustomValidity()
  • 16. Web Sockets Full duplex client-server communication SignalR (Open Source) WebSockets on IIS 8 + IE10/Chrome/Firefox Fallback to AJAX polling duplex public class Chat : Hub { public void Send(string message) { Clients.All.addMessage(message); } } var chat = $.connection.chat; chat.client.addMessage = function (message) { $('#messages').append('<li>' + message + '</li>'); }; $.connection.hub.start(); C# Javascrip t
  • 17. Thank you! Questions? Hrvoje Hudoletnjak software developer, MVP for ASP.NET/IIS http://hudosvibe.net http://twitter.com/hhrvoje hrvoje@hudoletnjak.com Some slides by Stephen Walther from http://Superexpert.com