剃刀reseverd话 [英] Razor reseverd words

查看:262
本文介绍了剃刀reseverd话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这剃刀语法整齐,有一些小事争吵。但我似乎无法在任何地方找到它...结果
什么是剃须刀保留字?结果
@using结果
@inherits结果
@functions结果
@section结果
你知道任何其他?

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?

推荐答案

下面剃刀保留关键字的列表(注意:这适用于CSHTML,vbhtml如下VB的规则):

Here's a list of Razor reserved keywords (Note: This applies to cshtml, vbhtml follows VB's rules):


  • 继承

  • 功能

  • 部分

  • 帮助

  • 模式(仅在MVC项目)

您可以使用这些逃 @(继承)

这是由剃须刀了解C#的关键字

These are C# keywords that are understood by Razor


  • 如果


  • 尝试


  • 的foreach

  • ,而

  • 开关

  • 锁定

  • 使用

  • 情况

  • 默认

您可以使用转义 @(@锁)(第 @ 用来逃避剃刀解析器和第二个 @ 用来躲避C#解析器)

You can escape them using @(@lock) (first @ is used to escape the Razor parser and the second @ is used to escape the C# parser)

这些都不是在RC保留,但将是RTM。 更新:这将有RTM任何功能。他们只是保留为将来使用。

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.


  • 命名空间


  • 布局

这篇关于剃刀reseverd话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆