Skip to content

Commit

Permalink
Fix indentation in code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaddie authored Mar 28, 2018
1 parent c8126dc commit d85d7ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aspnetcore/mvc/views/working-with-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ The Form Tag Helper above generates the following HTML:

```HTML
<form method="post" action="/Demo/Register">
<!-- Input and Submit elements -->
<input name="__RequestVerificationToken" type="hidden" value="<removed for brevity>" />
</form>
<!-- Input and Submit elements -->
<input name="__RequestVerificationToken" type="hidden" value="<removed for brevity>" />
</form>
```

The MVC runtime generates the `action` attribute value from the Form Tag Helper attributes `asp-controller` and `asp-action`. The Form Tag Helper also generates a hidden [Request Verification Token](https://docs.microsoft.com/aspnet/mvc/overview/security/xsrfcsrf-prevention-in-aspnet-mvc-and-web-pages) to prevent cross-site request forgery (when used with the `[ValidateAntiForgeryToken]` attribute in the HTTP Post action method). Protecting a pure HTML Form from cross-site request forgery is difficult, the Form Tag Helper provides this service for you.
Expand Down

0 comments on commit d85d7ab

Please sign in to comment.