SlideShare una empresa de Scribd logo
1 de 33
Bling-bling with MVC and jQuery Being a pimp without Silverlight Maarten Balliauw	@maartenballiauw Kris van der Mast	@KvdM
Who are we? – Maarten Maarten Balliauw Antwerp, Belgium www.realdolmen.com Focus on web ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, … MVP ASP.NET http://blog.maartenballiauw.be http://twitter.com/maartenballiauw
Who are we? – Kris Kris van der Mast Antwerp, Belgium www.ordina.be Focus on web technologies ASP.NET, ASP.NET MVC, WCF, Silverlight, ... MVP for ASP.NET ASP Insider http://blog.krisvandermast.com http://www.twitter.com/KvdM
Agenda ASP.NET WebForms ASP.NET MVC jQuery Resources Q&A
ASP.NET MVC Mega Very Cool?
The ASP.NET family ASP.NET Dynamic Data  & AJAX Presentation ASP.NET WebForms ASP.NET MVC ASP.NET Core Core  Runtime
ASP.NET WebForms
ASP.NET WebForms Taken programming model from WinForms Fake stateful model Automatic testing is hard
ASP.NET MVC Testability Control over HTML Extensibility It makes you think Learn new concepts “if you are allergic to porc,don’t go work in a sausage factory”
Model-View-Controller in ASP.NET MVC Model (“DTO” between C and V) Controller (Input) Request Response Application Logic View (Presentation)
Characteristics Maintain Clean Separation of Concerns Easy Testing  Red/Green TDD  Highly maintainable applications by default Extensible and Pluggable Support replacing any component of system
Characteristics Enable clean URLs and SEO SEO friendly URL structures Great ASP.NET integration All providers are supported Membership, Caching, Session, … ASP.NET designer in VS2008/VS2010
New in ASP.NET MVC2... Validation Strongly Typed HTML Helpers Templated HTML Helpers Areas Async Controllers
DEMO ASP.NET MVC
jQuery What is jQuery? JavaScript Abstraction “LINQ to DOM” Why use jQuery? Making JavaScript and the DOM suck less Easy to Use Rich Plug-in Ecosystem Cross Browser Support
Money, money, money! $
The Basics jQuery() and $() The ready() Function Effective when DOM is ready jQuery(document).ready(main); $(document).ready(main); $(document).ready(function() { … } ); $(function()  { … } ); function main() {     … }
jQuery Basics jQuery Wrappers jQuery Selectors $(selector) jQuery(selector)
Selectors Basic Selectors #id .class element	 selector1,selector2,selectorN,… * $(this)
Selectors Other Selector Categories Form Attribute Hierarchy Filter Content Child
It gives you power! functionvalidateForm() {     var f = document.forms[0];     var atLeastOneChecked = false; for (var i = 0; i < document.forms[0].length; i++) {         var e = document.forms[0][i]; if (e.type == "checkbox" &&  e.className == "group1" && e.checked) { atLeastOneChecked = true;         }     } if (!atLeastOneChecked) {         alert("Please check at least one item!");     }     return atLeastOneChecked; } functionvalidateForm() { if ($(".group1:checked").length == 0) { alert("Please check at least one item!");         return false; }    return true; }
Unobtrusive JavaScript Start with “plain old HTML” Layer on some CSS styling providing visual style Layer on some JavaScript providing enhanced behaviour
Events Unobtrusive JavaScript Cross Browser Support $(<selector>).eventname(<functionpointer> or inline);
Event Binding Binds events to matched sets $(selector).bind(“eventName",function);
Chaining Powerful Fluent $(selector).method $(selector).method({…}).method2({…});
Manipulating HTML html() Gets/sets the innerHTML  text() Gets/sets the innerText Method, not property syntax Other Methods append() prepend() appendTo() prependTo() remove
Plug-ins Rich Plug-in Ecosystem Thousands available Downloadable .js files You can create your own http://jQuery.com/plugins
Ajax Web Services WCF XMLHttpRequest $.ajax()
Ajax $.ajax({       type: "POST",       url: webMethod,       data: parameters,       contentType: "application/json; charset=utf-8",       dataType: "json",       success: function(msg) {                   $(selector).html(msg.d);       },       error: function(e){               $(selector).html(“error message");                                 } });
DEMO Want to see it being used?
Resources Learn more!
Resources http://www.jquery.com http://www.asp.net/mvc http://jqueryui.com/demos/ http://www.bing.com http://www.trirand.net/demoaspnetmvc.aspx
Questions? More information? http://asp.net/mvc http://jquery.com Contact us! http://blog.maartenballiauw.be http://blog.krisvandermast.com Thank you!

Más contenido relacionado

La actualidad más candente

Build an App with JavaScript and jQuery (DTLA, 06/21)
Build an App with JavaScript and jQuery (DTLA, 06/21)Build an App with JavaScript and jQuery (DTLA, 06/21)
Build an App with JavaScript and jQuery (DTLA, 06/21)Thinkful
 
EXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using GradleEXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using GradleEXPERTALKS
 
Creating asynchronous flows on AWS
Creating asynchronous flows on AWSCreating asynchronous flows on AWS
Creating asynchronous flows on AWSMetin Kale
 
Queueing at the Checkout
Queueing at the CheckoutQueueing at the Checkout
Queueing at the CheckoutWilliam Tracz
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.jsDieter De Mesmaeker
 
Creating Hyper Performant Web Apps with React
Creating Hyper Performant Web Apps with ReactCreating Hyper Performant Web Apps with React
Creating Hyper Performant Web Apps with ReactJp DeVries
 
Polymer, HTML includes y core-ajax
Polymer, HTML includes y core-ajaxPolymer, HTML includes y core-ajax
Polymer, HTML includes y core-ajaxRadamantis Torres
 
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)Barbara Ondrisek
 
Bentobox Exercise
Bentobox ExerciseBentobox Exercise
Bentobox ExerciseEster Kais
 
Breaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactBreaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactDejan Glozic
 
WebNano - Ideas for Web Frameworks
WebNano - Ideas for Web FrameworksWebNano - Ideas for Web Frameworks
WebNano - Ideas for Web Frameworksguestf89f9cb
 
Access Net Web Services From Java
Access  Net Web Services From JavaAccess  Net Web Services From Java
Access Net Web Services From JavaGuo Albert
 
Custom routing in asp.net mvc
Custom routing in asp.net mvcCustom routing in asp.net mvc
Custom routing in asp.net mvcCapgemini India
 
Rails-like Asp.Net Development Shared
Rails-like Asp.Net Development SharedRails-like Asp.Net Development Shared
Rails-like Asp.Net Development Sharedcurtismitchell
 
Which watcher watches CloudWatch
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch David Lutz
 
Dynamic to-static
Dynamic to-staticDynamic to-static
Dynamic to-staticbiilmann
 

La actualidad más candente (20)

Build an App with JavaScript and jQuery (DTLA, 06/21)
Build an App with JavaScript and jQuery (DTLA, 06/21)Build an App with JavaScript and jQuery (DTLA, 06/21)
Build an App with JavaScript and jQuery (DTLA, 06/21)
 
WebMatrix
WebMatrixWebMatrix
WebMatrix
 
EXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using GradleEXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using Gradle
 
Creating asynchronous flows on AWS
Creating asynchronous flows on AWSCreating asynchronous flows on AWS
Creating asynchronous flows on AWS
 
Queueing at the Checkout
Queueing at the CheckoutQueueing at the Checkout
Queueing at the Checkout
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.js
 
Creating Hyper Performant Web Apps with React
Creating Hyper Performant Web Apps with ReactCreating Hyper Performant Web Apps with React
Creating Hyper Performant Web Apps with React
 
Polymer, HTML includes y core-ajax
Polymer, HTML includes y core-ajaxPolymer, HTML includes y core-ajax
Polymer, HTML includes y core-ajax
 
Sprockets
SprocketsSprockets
Sprockets
 
What is new in ASP.NET Core
What is new in ASP.NET CoreWhat is new in ASP.NET Core
What is new in ASP.NET Core
 
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)
JQuery Conf Berlin - Ondrisek - From Java To AngularJS (without pain)
 
Bentobox Exercise
Bentobox ExerciseBentobox Exercise
Bentobox Exercise
 
Breaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and ReactBreaking the Server-Client Divide with Node.js and React
Breaking the Server-Client Divide with Node.js and React
 
WebNano - Ideas for Web Frameworks
WebNano - Ideas for Web FrameworksWebNano - Ideas for Web Frameworks
WebNano - Ideas for Web Frameworks
 
Ajax3
Ajax3Ajax3
Ajax3
 
Access Net Web Services From Java
Access  Net Web Services From JavaAccess  Net Web Services From Java
Access Net Web Services From Java
 
Custom routing in asp.net mvc
Custom routing in asp.net mvcCustom routing in asp.net mvc
Custom routing in asp.net mvc
 
Rails-like Asp.Net Development Shared
Rails-like Asp.Net Development SharedRails-like Asp.Net Development Shared
Rails-like Asp.Net Development Shared
 
Which watcher watches CloudWatch
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch
 
Dynamic to-static
Dynamic to-staticDynamic to-static
Dynamic to-static
 

Similar a Being a pimp without silverlight

CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jqueryciberglo
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web PerformanceAdam Lu
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - GoodiesJerry Emmanuel
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSunpawet Somsin
 
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)ASP.NET 3.5 SP1 (VSLive San Francisco 2009)
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)Dave Bost
 
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Fwdays
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Thinqloud
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript MisunderstoodBhavya Siddappa
 

Similar a Being a pimp without silverlight (20)

CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Walther Aspnet4
Walther Aspnet4Walther Aspnet4
Walther Aspnet4
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - Goodies
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5
 
html5
html5html5
html5
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
ASP.NET 4.0 Roadmap
ASP.NET 4.0 RoadmapASP.NET 4.0 Roadmap
ASP.NET 4.0 Roadmap
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)ASP.NET 3.5 SP1 (VSLive San Francisco 2009)
ASP.NET 3.5 SP1 (VSLive San Francisco 2009)
 
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
 
JavaScript Misunderstood
JavaScript MisunderstoodJavaScript Misunderstood
JavaScript Misunderstood
 

Más de Kris van der Mast

Microsoft chatbots - Conversations as a Platform
Microsoft chatbots - Conversations as a PlatformMicrosoft chatbots - Conversations as a Platform
Microsoft chatbots - Conversations as a PlatformKris van der Mast
 
Orchard - the new cms in town
Orchard -  the new cms in townOrchard -  the new cms in town
Orchard - the new cms in townKris van der Mast
 
A second life in the cloud for existing applications
A second life in the cloud for existing applicationsA second life in the cloud for existing applications
A second life in the cloud for existing applicationsKris van der Mast
 
Being a pimp without silverlight - ASP.NET MVC 2 and jQuery
Being a pimp without silverlight - ASP.NET MVC 2 and jQueryBeing a pimp without silverlight - ASP.NET MVC 2 and jQuery
Being a pimp without silverlight - ASP.NET MVC 2 and jQueryKris van der Mast
 

Más de Kris van der Mast (9)

Microsoft chatbots - Conversations as a Platform
Microsoft chatbots - Conversations as a PlatformMicrosoft chatbots - Conversations as a Platform
Microsoft chatbots - Conversations as a Platform
 
Visual Studio Code
Visual Studio CodeVisual Studio Code
Visual Studio Code
 
Meteor.js
Meteor.jsMeteor.js
Meteor.js
 
F12 tools in Edge
F12 tools in EdgeF12 tools in Edge
F12 tools in Edge
 
Orchard - the new cms in town
Orchard -  the new cms in townOrchard -  the new cms in town
Orchard - the new cms in town
 
A second life in the cloud for existing applications
A second life in the cloud for existing applicationsA second life in the cloud for existing applications
A second life in the cloud for existing applications
 
Azug feweb2010
Azug feweb2010Azug feweb2010
Azug feweb2010
 
Being a pimp without silverlight - ASP.NET MVC 2 and jQuery
Being a pimp without silverlight - ASP.NET MVC 2 and jQueryBeing a pimp without silverlight - ASP.NET MVC 2 and jQuery
Being a pimp without silverlight - ASP.NET MVC 2 and jQuery
 
Leb Dev Mvc2
Leb Dev Mvc2Leb Dev Mvc2
Leb Dev Mvc2
 

Being a pimp without silverlight

  • 1. Bling-bling with MVC and jQuery Being a pimp without Silverlight Maarten Balliauw @maartenballiauw Kris van der Mast @KvdM
  • 2. Who are we? – Maarten Maarten Balliauw Antwerp, Belgium www.realdolmen.com Focus on web ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, … MVP ASP.NET http://blog.maartenballiauw.be http://twitter.com/maartenballiauw
  • 3. Who are we? – Kris Kris van der Mast Antwerp, Belgium www.ordina.be Focus on web technologies ASP.NET, ASP.NET MVC, WCF, Silverlight, ... MVP for ASP.NET ASP Insider http://blog.krisvandermast.com http://www.twitter.com/KvdM
  • 4. Agenda ASP.NET WebForms ASP.NET MVC jQuery Resources Q&A
  • 5. ASP.NET MVC Mega Very Cool?
  • 6. The ASP.NET family ASP.NET Dynamic Data & AJAX Presentation ASP.NET WebForms ASP.NET MVC ASP.NET Core Core Runtime
  • 8. ASP.NET WebForms Taken programming model from WinForms Fake stateful model Automatic testing is hard
  • 9. ASP.NET MVC Testability Control over HTML Extensibility It makes you think Learn new concepts “if you are allergic to porc,don’t go work in a sausage factory”
  • 10. Model-View-Controller in ASP.NET MVC Model (“DTO” between C and V) Controller (Input) Request Response Application Logic View (Presentation)
  • 11. Characteristics Maintain Clean Separation of Concerns Easy Testing Red/Green TDD Highly maintainable applications by default Extensible and Pluggable Support replacing any component of system
  • 12. Characteristics Enable clean URLs and SEO SEO friendly URL structures Great ASP.NET integration All providers are supported Membership, Caching, Session, … ASP.NET designer in VS2008/VS2010
  • 13. New in ASP.NET MVC2... Validation Strongly Typed HTML Helpers Templated HTML Helpers Areas Async Controllers
  • 15. jQuery What is jQuery? JavaScript Abstraction “LINQ to DOM” Why use jQuery? Making JavaScript and the DOM suck less Easy to Use Rich Plug-in Ecosystem Cross Browser Support
  • 17. The Basics jQuery() and $() The ready() Function Effective when DOM is ready jQuery(document).ready(main); $(document).ready(main); $(document).ready(function() { … } ); $(function() { … } ); function main() { … }
  • 18. jQuery Basics jQuery Wrappers jQuery Selectors $(selector) jQuery(selector)
  • 19. Selectors Basic Selectors #id .class element selector1,selector2,selectorN,… * $(this)
  • 20. Selectors Other Selector Categories Form Attribute Hierarchy Filter Content Child
  • 21. It gives you power! functionvalidateForm() { var f = document.forms[0]; var atLeastOneChecked = false; for (var i = 0; i < document.forms[0].length; i++) { var e = document.forms[0][i]; if (e.type == "checkbox" && e.className == "group1" && e.checked) { atLeastOneChecked = true; } } if (!atLeastOneChecked) { alert("Please check at least one item!"); } return atLeastOneChecked; } functionvalidateForm() { if ($(".group1:checked").length == 0) { alert("Please check at least one item!"); return false; } return true; }
  • 22. Unobtrusive JavaScript Start with “plain old HTML” Layer on some CSS styling providing visual style Layer on some JavaScript providing enhanced behaviour
  • 23. Events Unobtrusive JavaScript Cross Browser Support $(<selector>).eventname(<functionpointer> or inline);
  • 24. Event Binding Binds events to matched sets $(selector).bind(“eventName",function);
  • 25. Chaining Powerful Fluent $(selector).method $(selector).method({…}).method2({…});
  • 26. Manipulating HTML html() Gets/sets the innerHTML text() Gets/sets the innerText Method, not property syntax Other Methods append() prepend() appendTo() prependTo() remove
  • 27. Plug-ins Rich Plug-in Ecosystem Thousands available Downloadable .js files You can create your own http://jQuery.com/plugins
  • 28. Ajax Web Services WCF XMLHttpRequest $.ajax()
  • 29. Ajax $.ajax({ type: "POST", url: webMethod, data: parameters, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { $(selector).html(msg.d); }, error: function(e){ $(selector).html(“error message"); } });
  • 30. DEMO Want to see it being used?
  • 32. Resources http://www.jquery.com http://www.asp.net/mvc http://jqueryui.com/demos/ http://www.bing.com http://www.trirand.net/demoaspnetmvc.aspx
  • 33. Questions? More information? http://asp.net/mvc http://jquery.com Contact us! http://blog.maartenballiauw.be http://blog.krisvandermast.com Thank you!

Notas del editor

  1. MVC is a design pattern that stands for Model-View-Controller. What is strives to do is separate the concerns of an application’s presentation layer by assigning specific roles to the three different components.The Controller is responsible for handling all user input. Once input has been received, the Controller will perform any operations/actions it needs to, which might include interacting with the Model.The Model represents the core concern/logic of the application. Once the Controller retrieves some model data and performs any work with the model/etc it needs to it constructs a presentation model that describes the model in terms the View can understand.The View is the visual representation of the model. It presents the model data to the actual user in a way that is meaningful. In a web application, this would typically be HTML.With these three pieces in place, your presentation layer becomes cleanly separated in such a way that each component can be developed/tested independently.
  2. -Model has onepurpose-Controller has onepurpose-View really handles the view, no business logic in there!-Each part is replacable-Source code availableonCodePlex. Not open source, butenablesyou to buildyourown, private flavour
  3. -Usersexpect clean URLsnowadays-Notreplacing ASP.NET  built on top of it
  4. -Usersexpect clean URLsnowadays-Notreplacing ASP.NET  built on top of it