Monday, July 5, 2010

Sharpening Your Markup with "Razor"

ASP.NET MVC has a new View Engine that it will ship with. The codename is "Razor" and to boil down Scott Guthrie's post here is my brief summary.

Razor condenses and makes the markup more concise, while preserving support for HTML Helpers.

<a href="@model.Id">@model.Name</a>

//Or the HTML Helper Version
@Html.ActionLink(Model.Name, Model.Id)

Essentially it replace <%= and %> with @.

There are also improvements to Master Pages, which are called Site Layouts which further reduce markup. All in all it feels much more Rails like.

The engine will be going through a public beta shortly.

No comments: