且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MVC 3 ASPX VS的Razor视图引擎

更新时间:2023-12-06 12:11:16

斯科特谷涵盖了大多数的问题在他的剃刀的入门博客文章

Scott Gu covered most of your questions in his Razor introductory blog post:

我们一直在新的视图引擎选项
  工作是围绕HTML优化
  代使用code-重点
  模板方法

The new view-engine option we’ve been working on is optimized around HTML generation using a code-focused templating approach

...


      
  • 紧凑型,防爆pressive和流体:剃刀减少数量
      字符和按键需要
      一个文件,实现了快速,流畅
      编码工作流程。不同于大多数模板
      语法,你不需要中断
      您的编码明确表示
      你的HTML中的服务器模块。该
      解析器是足够聪明的推断此
      从code。这使得一个真正
      小巧的前pressive语法是
      干净,快速,有趣键入

  • Compact, Expressive, and Fluid: Razor minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow. Unlike most template syntaxes, you do not need to interrupt your coding to explicitly denote server blocks within your HTML. The parser is smart enough to infer this from your code. This enables a really compact and expressive syntax which is clean, fast and fun to type.

轻松学习:剃刀是简单易学,使您能够快速成为
  生产用最少的概念。
  您可以使用您现有的所有的语言和
  HTML技能。

Easy to Learn: Razor is easy to learn and enables you to quickly be productive with a minimum of concepts. You use all your existing language and HTML skills.

是不是一种新的语言:我们有意识地选择了不创建一个新的
  命令式语言用剃刀。
  相反,我们希望能够让开发人员
  使用其现有的C#/ VB(或其它)
  语言能力剃刀,和
  提供一个模板标记语法
  使一个真棒HTML建设
  工作与您所选择的语言。

Is not a new language: We consciously chose not to create a new imperative language with Razor. Instead we wanted to enable developers to use their existing C#/VB (or other) language skills with Razor, and deliver a template markup syntax that enables an awesome HTML construction workflow with your language of choice.

与任何文本编辑器作品:剃须刀并不需要特定的工具
  使您能够在生产
  任何普通的文本编辑器(记事本
  伟大工程)。

Works with any Text Editor: Razor doesn’t require a specific tool and enables you to be productive in any plain old text editor (notepad works great).

有很大的智能感知:当剃刀被设计成不需要
  特定工具或code编辑器,它
  将有真棒语句完成
  Visual Studio中的支持。我们将
  更新的Visual Studio 2010和Visual
  Web开发人员2010年有充分的编辑器
  智能感知它。

Has great Intellisense: While Razor has been designed to not require a specific tool or code editor, it will have awesome statement completion support within Visual Studio. We’ll be updating Visual Studio 2010 and Visual Web Developer 2010 to have full editor intellisense for it.