DCSIMG
razor - IronShay

Browse by Tags

All Tags » razor (RSS)

Razor Tip #2: Output Text in Code Context

Razor, the new ASP.NET MVC view engine is incredible. I like it. A LOT. Great work Microsoft! In this series of posts I’m sharing some handy tips and tricks that can enhance your experience with this new view engine. Enjoy! The Problem Razor is the place where HTML and C# live together in harmony. This is, in my opinion, one of the things that make razor the great view engine that it is. However, there’s a fly in the ointment. Assume you want to output “Good Morning!” if the hour is between 6AM and...
Posted by shayf | with no comments

Razor Tip #1: Explicitly Stating Statement Boundaries

Razor, the new ASP.NET MVC view engine is incredible. I like it. A LOT. Great work Microsoft! In this series of posts I’m going to share some handy tips and tricks that can enhance your experience with this new view engine. Enjoy! The Problem You have to output a variable value and add some markup content immediately after it. For example, assume you have a variable holding a value representing a font size and you want to output it inside a style attribute, as follows: But oh no! Razor can’t tell...
Posted by shayf | with no comments
תגים:, , ,

Slides + Code Samples from my Session at SDC2011

Today I had the honor to talk before the Scandinavian crowd in Gothenburg at SDC2011 . My session was “The Big Comparison of ASP.NET MVC View Engines” where I compared ASPX, Razor, Spark, NHaml and the StringTemplate view engines. Thanks to everyone who attended! I hope you had as much fun as I had!   The code samples from the session can be downloaded from my github account: https://github.com/shayfriedman/AspNetMvcViewEnginesSamples And here are the slides: The Big Comparison of ASP.NET MVC...

The Razor View Engine Basics

[cross-posted from my main blog: http://www.ironshay.com/post/The-Razor-View-Engine-Basics.aspx ] If you’ve been following me, you probably noticed that I became quite excited with the new view engine of ASP.NET MVC 3 – the razor view engine. If you’re familiar with it then you might agree or disagree with me, but if you don’t then this is a great time for you to make up your mind! In this post I assume you are familiar with the concept of view engines. If not, please watch this before. Let’s start...
Posted by shayf | 1 comment(s)
תגים:, ,