Take Razor for a test drive and discover first hand how this scripting syntax simplifies the way you create dynamic, data-driven websites. With this concise guide, you’ll work with Razor syntax by building example websites with Microsoft WebMatrix and ASP.NET MVC. You'll quickly learn how Razor lets you combine code and content in a fluid and expressive manner on Windows-based servers.
Programming Razoralso explores components of the Razor API, and shows you how Razor templates are turned into rendered HTML. By the end of this book, you'll be able to create Razor-based websites with custom extensions that meet the specific needs of your projects.
- Use Razor with Microsoft WebMatrix to build a working blog, complete with data
- Organize and manage your web application, using Razor features for layouts, sections, and partial views
- Create clean and effective ASP.NET MVC views with the Razor View Engine
- Learn how the Razor API interprets Razor templates and turns them into executable .NET code
- Implement advanced techniques for exposing reusable code and sharing ASP.NET MVC views across projects
Preface;RazorPad: A Lightweight Razor Editor;Conventions Used in This Book;Using Code Examples;Safari? Books Online;How to Contact Us;Chapter 1: Introduction;1.1 A Brief History of Microsofts Web Development Platforms;1.2 Hello, Razor!;1.3 Differentiating Code and Markup;1.4 Comments;Chapter 2: Razor and Microsoft WebMatrix;2.1 Introducing ASP.NET Web Pages;2.2 Installing WebMatrix;2.3 Your First WebMatrix Website;2.4 Data Access with WebMatrix;Chapter 3: Organizing Razor Templates;3.1 Layouts;3.2 Partial Views;3.3 Razor Helpers;3.4 Razor Helper Packages;3.5 Razor Helpers versus Partial Views;3.6 Executing Common Code;Chapter 4: Razor and ASP.NET MVC;4.1 Installing ASP.NET MVC;4.2 ASP.NET MVC View Engines;4.3 Implementing a Blog Site Using ASP.NET MVC;4.4 Authoring ASP.NET MVC Views with the Razor lƒ"