SlideShare a Scribd company logo
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

More Related Content

PPTX
Event sourcing your React-Flux applications
PPT
Introduction to ASP.NET MVC 1.0
PDF
Asp.net mvc basic introduction
PPTX
ASP .Net MVC 5
PDF
Introducing Pebble SDK 2.0
PPTX
Mvc summary
PPTX
Angular on ASP.NET MVC 6
PPTX
TypeScript and SharePoint Framework
Event sourcing your React-Flux applications
Introduction to ASP.NET MVC 1.0
Asp.net mvc basic introduction
ASP .Net MVC 5
Introducing Pebble SDK 2.0
Mvc summary
Angular on ASP.NET MVC 6
TypeScript and SharePoint Framework

What's hot (20)

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

Similar to RIA / SPA with ASP.NET (20)

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

More from Hrvoje Hudoletnjak (7)

PPTX
Project K, Vnext and Owin
PPTX
Owin katana en
PPTX
EF6 and DDD
PPTX
ATD9 2013 One ASP.NET
PPTX
My weekend startup: seocrawler.co
PPTX
ASP.NET: Present and future
PPTX
Open source and .net
Project K, Vnext and Owin
Owin katana en
EF6 and DDD
ATD9 2013 One ASP.NET
My weekend startup: seocrawler.co
ASP.NET: Present and future
Open source and .net

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Review of recent advances in non-invasive hemoglobin estimation
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Understanding_Digital_Forensics_Presentation.pptx

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