That the razor syntax is neat, there's little arguing about. But i can't seem to find it anywhere...
What are the razor reserved words?
@using
@inherits
@functions
@section
Do you know any other?
相关问题
- Entity Framework throws exception - Network Relate
- Slow loading first page - ASP.NET MVC
- TextBoxFor decimal
- How to do an inline style with asp.net mvc 3 razor
- How to access the System.ComponentModel.DataAnnota
相关文章
- “Dynamic operations can only be performed in homog
- Change color of bars depending on value in Highcha
- How to get server path of physical path ?
- Breakpoint in ASP.NET MVC Razor view will not be h
- How to define function that returns html in asp.ne
- How to find the exceptions / errors when TryUpdate
- ASP.Net MVC 3: optgroup support in Html.DropDownLi
- A circular reference was detected while serializin
Here's a list of Razor reserved keywords (Note: This applies to cshtml, vbhtml follows VB's rules):
Razor-specific keywords
You can escape these using
@(inherits)
Language-specific Razor keywords
These are C# keywords that are understood by Razor
You can escape them using
@(@lock)
(first@
is used to escape the Razor parser and the second@
is used to escape the C# parser)Reserved keywords
These are not reserved in RC but will be for RTM. Update: These will have no functionality for RTM. They are simply reserved for future use.
You've got them all. The only one I know of that's in the RC is @model but I don't see that in the list of RazorKeywords from the source so I'm not sure how that one is used or parsed.
If you check the source file "CSharpCodeParser.cs" under the WebPages/System.Web.Razor project you'll find a list of RazorKeywords.