ASP.NET Razor
Razor是ASP.NET的一种采用C#或VB.NET语言创建动态网页的方法。
.razor , .cshtml , .vbhtml | |
text/html | |
开发者 | Microsoft |
历史
Razor于2010年6月开发[2]。2011年1月随Microsoft Visual Studio 2010发布。[3]并作为MVC 3和WebMatrix 工具集的一部分。[3]
Razor已经是AspNetWebStack和ASP.NET Core的一部分。
设计
ASP.NET Web Forms (.aspx)使用<%= %>
符号指出代码块的边界。但Razor语法采用@
字符指出代码块。[4]减少了键盘输入。[2]其他优点还有:[5]
- 支持IntelliSense – 语句自动补全
- 支持"layouts" – Web Forms (.aspx)"master page"概念的另一种实现。
- 单元测试
参见
参考文献
外部链接
維基教科書中的相關電子:.NET Development Foundation |
- Introduction to Razor Pages in ASP.NET Core at Microsoft Docs
- ASP.NET Web Pages (页面存档备份,存于) at Microsoft Docs
- Tutorial: Get started with Razor Pages in ASP.NET Core by Rick Anderson 02/19/2022 (页面存档备份,存于)
- Overview of ASP.NET Core MVC (页面存档备份,存于) at Microsoft Docs
- ASP.NET MVC (页面存档备份,存于) at Microsoft Docs
- GitHub上的Razor頁面 (archived). Current development is held at GitHub上的aspnetcore頁面
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.