0 Replies - 12576 Views - Last Post: 21 January 2011 - 07:18 PM Rate Topic: -----

#1 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

ASP.NET MVC 3: Razor's @: and <text> syntax

Posted 21 January 2011 - 07:18 PM

MVC3: Razor syntax

Quote

Fluid Coding with Razor

ASP.NET MVC 3 ships with a new view-engine option called “Razor” (in addition to the existing .aspx view engine). You can learn more about Razor, why we are introducing it, and the syntax it supports from my Introducing Razor blog post.

Razor minimizes the number of characters and keystrokes required when writing a view template, and enables a fast, fluid coding workflow. Unlike most template syntaxes, you do not need to interrupt your coding to explicitly denote the start and end of server blocks within your HTML. The Razor parser is smart enough to infer this from your code. This enables a compact and expressive syntax which is clean, fast and fun to type.


Has anyone here used the Razor syntax yet and, if so, do you prefer it to the asp.net "<% %>" code block syntax. Looking over the article it seems, to me at least, that the razor syntax is quite a bit easier to read and as noted in the article would definitely save time in keystrokes.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1