Razor and the Art of Templating<br />Jess Chadwick<br />Team Lead / Architect / RIA Specialist<br />blog.jesschadwick.com<...
<ul><li>Razor basics
Razor & ASP.NET MVC
Extending Razor</li></ul>Agenda<br />
What is Razor?<br />
What is Razor?<br />
A New View<br />
Simplicity <br />&<br />Elegance<br />Code & Markup<br />
DEMOASPX vs. Razor<br />
Creating Views<br />
Combine code and markup<br /><ul><li>Don’t think about it</li></ul>@indicates a code block<br />Standard language keywords...
<ul><li>Create a main site layout(think “Master Page”)
Implement content of each page in sections
Think ContentPlaceHolder
RenderBody()
RenderSection()</li></ul>Designing a Site Layout<br />
<ul><li>functions keyword defines a code section(think <script runat=“server”>)
helper keyword defines a reusable Razor section</li></ul>Functions and Helpers<br />
Razor and ASP.NET MVC<br />Like peanut butter and chocolate<br />
New Keyword:<br />model<br />
Upcoming SlideShare
Loading in...5
×

Razor and the Art of Templating

3,409

Published on

Though I deliberately went easy on the slides and heavy on the code, there might be a few nuggets in here so I'm posting it anyway. Enjoy!

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

No Downloads
Views
Total Views
3,409
On Slideshare
0
From Embeds
0
Number of Embeds
39
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Razor and the Art of Templating

  1. 1. Razor and the Art of Templating<br />Jess Chadwick<br />Team Lead / Architect / RIA Specialist<br />blog.jesschadwick.com<br />@jchadwick<br />jesschadwick@gmail.com<br />
  2. 2. <ul><li>Razor basics
  3. 3. Razor & ASP.NET MVC
  4. 4. Extending Razor</li></ul>Agenda<br />
  5. 5. What is Razor?<br />
  6. 6. What is Razor?<br />
  7. 7. A New View<br />
  8. 8. Simplicity <br />&<br />Elegance<br />Code & Markup<br />
  9. 9. DEMOASPX vs. Razor<br />
  10. 10. Creating Views<br />
  11. 11. Combine code and markup<br /><ul><li>Don’t think about it</li></ul>@indicates a code block<br />Standard language keywordse.g. foreach, using, inherits, etc.<br />Basic Syntax: 3 Simple Rules<br />
  12. 12. <ul><li>Create a main site layout(think “Master Page”)
  13. 13. Implement content of each page in sections
  14. 14. Think ContentPlaceHolder
  15. 15. RenderBody()
  16. 16. RenderSection()</li></ul>Designing a Site Layout<br />
  17. 17. <ul><li>functions keyword defines a code section(think <script runat=“server”>)
  18. 18. helper keyword defines a reusable Razor section</li></ul>Functions and Helpers<br />
  19. 19. Razor and ASP.NET MVC<br />Like peanut butter and chocolate<br />
  20. 20. New Keyword:<br />model<br />
  21. 21. Pause… Time out.<br />It’s gonna get scary.<br />
  22. 22. The Razor API<br />Diving deeper…<br />
  23. 23. Engine<br />Host<br />Parser<br />Generator<br />The Razor API<br />
  24. 24. Code + Markup<br />Parsed Document<br />Code Compile Unit<br />.NET Class<br />Lifecycle of a Razor Template<br />
  25. 25. Questions / Comments?<br />
  26. 26. My blog: blog.jesschadwick.com<br />RazorPad: razorpad.codeplex.com<br />Razor Syntax Tutorial:http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax<br />Resources<br />
  27. 27. The <br />Razor View <br />Lifecycle<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×