Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introducing the ASP.NET MVC 3

1,877 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introducing the ASP.NET MVC 3

  1. 1. ASP.NET MVC 3 Training for Heroes <br />WELCOME TO MVC SHINE DAY<br />LêDươngCôngPhúc<br />SESSION 2: ASP.NET MVC 3 OVERVIEW<br />
  2. 2. Who am I?<br />LêDươngCôngPhúc<br />Technical evangelism<br />Software engineer at Vina Digital Co,. Ltd.<br />
  3. 3. Introducing “MVC Shine” application<br />Exercise 2<br />Implementing simple CRUD functionalities using Razor view engine <br />
  4. 4. Razor Syntax<br />@if (User.Grok(Razor)) {<br /> <div>w00t!</div><br />}<br /><ul><li>New, Simplified View Engine
  5. 5. Write fewer lines of code
  6. 6. More natural mix code and markup
  7. 7. Helpers save you time
  8. 8. Compatible with ASP.NET Web Pages in WebMatrix</li></li></ul><li>Web Forms vs. PHP vs. Razor<br />Web Forms (6 markup transitions):<br /><ul><br /><% for (int i = 0; i < 10; i++) { %><br /> <li><% =i %></li><br /><% } %><br /></ul><br /><ul><br /><?php<br />for ($i = 0; $i < 10; $i++) {<br />echo("<li>$i</li>");<br /> } <br /> ?><br /></ul><br />PHP(2 markup transitions & an echo):<br /><ul><br />@for (int i = 0; i < 10; i++) {<br /> <li>@i</li><br /> }<br /></ul><br />Razor (2 markup transitions):<br />
  9. 9. Razor Syntax<br />
  10. 10. Directives<br />
  11. 11. Layouts make organizing your pages easier<br />Don’t repeat yourself!<br />Define one layout and use it across your website<br />Page 1<br />Layout.cshtml<br />Page 2<br />Page 3<br />

×