Format Razor example in overview as cshtml (#13383)
parent
4f95255249
commit
79a08f56bc
|
@ -3,7 +3,7 @@ title: Overview of ASP.NET Core MVC
|
|||
author: ardalis
|
||||
description: Learn how ASP.NET Core MVC is a rich framework for building web apps and APIs using the Model-View-Controller design pattern.
|
||||
ms.author: riande
|
||||
ms.date: 01/08/2018
|
||||
ms.date: 08/01/2019
|
||||
uid: mvc/overview
|
||||
---
|
||||
# Overview of ASP.NET Core MVC
|
||||
|
@ -96,7 +96,7 @@ ASP.NET Core MVC [model binding](models/model-binding.md) converts client reques
|
|||
|
||||
```csharp
|
||||
public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null) { ... }
|
||||
```
|
||||
```
|
||||
|
||||
### Model validation
|
||||
|
||||
|
@ -143,6 +143,7 @@ Your app can also use [dependency injection in view files](views/dependency-inje
|
|||
|
||||
```cshtml
|
||||
@inject SomeService ServiceName
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -183,7 +184,7 @@ The framework's use of interfaces and dependency injection make it well-suited t
|
|||
|
||||
[ASP.NET Core MVC views](views/overview.md) use the [Razor view engine](views/razor.md) to render views. Razor is a compact, expressive and fluid template markup language for defining views using embedded C# code. Razor is used to dynamically generate web content on the server. You can cleanly mix server code with client side content and code.
|
||||
|
||||
```text
|
||||
```cshtml
|
||||
<ul>
|
||||
@for (int i = 0; i < 5; i++) {
|
||||
<li>List item @i</li>
|
||||
|
|
Loading…
Reference in New Issue