Knockout js with mvc

1,450 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,450
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Knockout js with mvc

  1. 1. KnockoutJS withASP.NET MVCJOEL COCHRAN
  2. 2. About Me Expression Blend MVP ASPInsider Manager Consultant, Sogeti joelcochran@gmail.com @joelcochran joelcochran.com
  3. 3. Windows 8 apps with HTML5 andJavaScript manning.com/shultz/ 37% off! Use promo code: win8app37
  4. 4. http://madexpo.us
  5. 5. KnockoutJS: MVVM for the web Separation of concerns Data binding Uses modern HTML5 Pure JavaScript
  6. 6. Scripts we’ll use jQuery – jQuery.com Knockout – knockoutjs.com Knockout mapping All available through Nuget
  7. 7. Traditional ASP.NET MVC Pros Strongly Typed Razor syntax (familiar) Intellisense Start with Templates Cons Embedded JavaScript Poor Intellisense No separation
  8. 8. Stop! Demo time
  9. 9. Knockout Mapping Fast and (almost) painless Allows for separation BUT Ties Knockout ViewModel to ASP.NET ViewModel
  10. 10. Stop! Demo time
  11. 11. AJAX Calls within Controller Flexible Responsive Performant Can be done right in the Controller Good and bad: Can clutter up your Controller
  12. 12. Stop! Demo time
  13. 13. AJAX calls outside the Controller Service calls True separation Can be used in many applications/formats ASP.NET MVC 4 has this built in with WebApi Fits very well with the KO approach
  14. 14. Stop! Demo time
  15. 15. Thanks joelcochran@gmail.com @joelcochran joelcochran.com

×