This post gets enough said about how the Razor parser works.
After reading it and a quick chat with @Haacked on twitter, it seems all your “escape” kind of Razor expressions (that is meaning: when mixing code and text without spaces etc…) will look like @(someCode)someText. This is coming from an example, to escape a C# identifier that’s also a keyword, say “class”, you’d be using @(@class). The @(…) style is the new <%: … %> but only required for escape situations.
Also, it seems that switching from being equivalent to <%: … %> to being equivalent to <%= … %> by using some Razor notation is not gonna make it. You need to do it through doing some classes implementing IHtmlString interface.
Of course I’m not so sure that’s exactly the case. Anyway, Razor is only available now in WebMatrix mini-IDE, not much MVC love yet (pretty soon). Just thought it might be interesting…
P.S. Please help me out by checking this offer, then look below for a small Thank You.
How did I learn that?
As a bonus for coming here, I'm giving away a free newsletter for web developers that you can sign up for from here.
It's not an anything-and-everything link list. It's thoughtfully collected picks of articles and tools, that focus on Angular 2, ASP.NET 5, and other fullstack developer goodies.