ASP.NET Razor

Last updated
Razor
Original author(s) Microsoft
Developer(s) .NET Foundation
Initial releaseJune 2010;13 years ago (2010-06)
Stable release
3.2.7 / November 29, 2018;5 years ago (2018-11-29) [1]
Preview release
4.0.0-rc1 / November 18, 2015;8 years ago (2015-11-18)
Repository github.com/aspnet/Razor
github.com/aspnet/AspNetWebStack
github.com/dotnet/aspnetcore
Written in C#, VB.NET, HTML
Operating system Microsoft Windows [2]
Type Web application framework
License Apache License 2.0 [3]
Website www.asp.net/web-pages
Razor file formats
Filename extension
.razor, .cshtml, .vbhtml
Internet media type
text/html
Developed by Microsoft

Razor is an ASP.NET programming syntax used to create dynamic web pages with the C# or VB.NET programming languages. Razor was in development in June 2010 [4] and was released for Microsoft Visual Studio 2010 in January 2011. [5] Razor is a simple-syntax view engine and was released as part of MVC 3 and the WebMatrix tool set. [5]

Contents

Razor became a component of AspNetWebStack and then became a part of ASP.NET Core. [6]

Design

The Razor syntax is a template markup syntax, based on the C# programming language, that enables the programmer to use an HTML construction workflow.[ clarification needed ] Instead of using the ASP.NET Web Forms (.aspx) markup syntax with <%= %> symbols to indicate code blocks, Razor syntax starts code blocks with an @ character and does not require explicit closing of the code-block.

The idea behind Razor is to provide an optimized syntax for HTML generation using a code-focused templating approach, with minimal transition between HTML and code. [7] The design reduces the number of characters and keystrokes, and enables a more fluid coding workflow by not requiring explicitly denoted server blocks within the HTML code. [4] Other advantages that have been noted: [8]

See also

Related Research Articles

Active Server Pages (ASP) is Microsoft's first server-side scripting language and engine for dynamic web pages.

JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser.

Extensible Application Markup Language is a declarative XML-based language developed by Microsoft for initializing structured values and objects. It is available under Microsoft's Open Specification Promise.

ASP.NET is a server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name stands for Active Server Pages Network Enabled Technologies.

<span class="mw-page-title-main">Microsoft WebMatrix</span>

Microsoft WebMatrix is a discontinued cloud-connected website builder and HTML editor for Windows, geared towards web development. WebMatrix enables developers to build websites using built-in templates or popular open-source applications, with full support for ASP.NET, PHP, Node.js and HTML5. Microsoft developed WebMatrix for the purpose of providing web developers with coding, customization, and publishing capabilities all in one place.

A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form. Lightweight markup languages are used in applications where it may be necessary to read the raw document as well as the final rendered output.

Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.

Sandcastle is a documentation generator from Microsoft. It automatically produces MSDN-style code documentation out of reflection information of .NET assemblies and XML documentation comments found in the source code of these assemblies. It can also be used to produce user documentation from Microsoft Assistance Markup Language (MAML) with the same look and feel as reference documentation.

Azure DevOps Server, formerly known as Team Foundation Server (TFS) and Visual Studio Team System (VSTS), is a Microsoft product that provides version control, reporting, requirements management, project management, automated builds, testing and release management capabilities. It covers the entire application lifecycle and enables DevOps capabilities. Azure DevOps can be used as a back-end to numerous integrated development environments (IDEs) but is tailored for Microsoft Visual Studio and Eclipse on all platforms.

ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is proprietary.

Text Template Transformation Toolkit is a free and open-source template-based text generation framework. T4 source files are usually denoted by the file extension ".tt".

C1 CMS

C1 CMS is a free open source .NET-based web content management system.

An ASP.NET HTTP handler is a process that runs in response to a request made to an ASP.NET Web application. The most common handler is the ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler.

Mustache is a web template system. Mustache is described as a logic-less system because it lacks any explicit control flow statements, like if and else conditionals or for loops; however, both looping and conditional evaluation can be achieved using section tags processing lists and anonymous functions (lambdas). It is named "Mustache" because of heavy use of braces, { }, that resemble a sideways moustache. Mustache is used mainly for mobile and web applications.

ASP.NET Core is an open-source modular web-application framework. It is a redesign of ASP.NET that unites the previously separate ASP.NET MVC and ASP.NET Web API into a single programming model. Despite being a new framework, built on a new web stack, it does have a high degree of concept compatibility with ASP.NET. The ASP.NET Core framework supports side-by-side versioning so that different applications being developed on a single machine can target different versions of ASP.NET Core. This was not possible with previous versions of ASP.NET. ASP.NET Core initially ran on both the Windows-only .NET Framework and the cross-platform .NET. However, support for the .NET Framework was dropped beginning with ASP.Net Core 3.0.

ASP.NET Web Forms is a web application framework and one of several programming models supported by the Microsoft ASP.NET technology. Web Forms applications can be written in any programming language which supports the Common Language Runtime, such as C# or Visual Basic. The main building blocks of Web Forms pages are server controls, which are reusable components responsible for rendering HTML markup and responding to events. A technique called view state is used to persist the state of server controls between normally stateless HTTP requests.

Blazor is a free and open-source web framework that enables developers to create web user interfaces (UI) based on components, using C# and HTML. It is being developed by Microsoft, as part of the ASP.NET Core web app framework.

Microsoft Docs was a library of technical documentation for end users, developers, and IT professionals who work with Microsoft products. The Microsoft Docs website provided technical specifications, conceptual articles, tutorials, guides, API references, code samples and other information related to Microsoft software and web services. Microsoft Docs was introduced in June 2016 as a replacement of the MSDN and TechNet libraries which previously hosted some of these materials. Microsoft Docs initially contained only .NET documentation. The process of migrating the bulk of the MSDN and TechNet libraries' content took approximately two years.

References

  1. "Microsoft ASP.NET Razor". NuGet .
  2. "Introduction to Razor Pages in ASP.NET Core". learn.microsoft.com.
  3. "Razor/LICENSE.txt at master · aspnet/Razor · GitHub". GitHub. 12 October 2022.
  4. 1 2 "ScottGu's Blog - Introducing "Razor" – a new view engine for ASP.NET". asp.net.
  5. 1 2 "MSDN Blogs". msdn.com. Microsoft. Archived from the original on 2012-07-02. Retrieved 2011-07-08.
  6. Chadwick, Jess (9 September 2011). Programming Razor: Tools for Templates in ASP.NET MVC or WebMatrix. "O'Reilly Media, Inc.". ISBN   978-1-4493-1716-4.
  7. Jon Galloway. "MVC 3 - Razor View Engine". The Official Microsoft ASP.NET Site.
  8. "ASP.NET MVC View Engine Comparison". stackoverflow.com.