You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`[BindProperty]` should **not** be used on models containing properties that should not be changed by the client. For more information, see [Overposting](xref:data/ef-rp/crud#overposting)
183
+
`[BindProperty]` should **not** be used on models containing properties that should not be changed by the client. For more information, see [Overposting](xref:data/ef-rp/crud#overposting).
184
184
185
185
Razor Pages, by default, bind properties only with non-`GET` verbs. Binding to properties removes the need to writing code to convert HTTP data to the model type. Binding reduces code by using the same property to render form fields (`<input asp-for="Customer.Name">`) and accept the input.
186
186
@@ -207,7 +207,7 @@ The *Index.cshtml* file contains the following markup:
The `<a /a>`[Anchor Tag Helper](xref:mvc/views/tag-helpers/builtin-th/anchor-tag-helper) used the `asp-route-{value}` attribute to generate a link to the Edit page. The link contains route data with the contact ID. For example, `https://localhost:5001/Edit/1`. [Tag Helpers](xref:mvc/views/tag-helpers/intro) enable server-side code to participate in creating and rendering HTML elements in Razor files.
210
+
The `<a /a>`[Anchor Tag Helper](xref:mvc/views/tag-helpers/builtin-th/anchor-tag-helper) used the `asp-route-{value}` attribute to generate a link to the Edit page. The link contains route data with the contact ID. For example, `https://localhost:5001/Edit/1`. [Tag Helpers](xref:mvc/views/tag-helpers/intro) enable server-side code to participate in creating and rendering HTML elements in Razor files.
211
211
212
212
The *Index.cshtml* file contains markup to create a delete button for each customer contact:
213
213
@@ -293,7 +293,7 @@ Consider the following `Movie` model:
293
293
294
294
The validation attributes specify behavior to enforce on the model properties they're applied to:
295
295
296
-
* The `Required` and `MinimumLength` attributes indicate that a property must have a value; but nothing prevents a user from entering white space to satisfy this validation.
296
+
* The `Required` and `MinimumLength` attributes indicate that a property must have a value, but nothing prevents a user from entering white space to satisfy this validation.
297
297
* The `RegularExpression` attribute is used to limit what characters can be input. In the preceding code, "Genre":
298
298
299
299
* Must only use letters.
@@ -332,13 +332,13 @@ Razor Pages falls back to calling the `OnGet` handler if no `OnHead` handler is
332
332
333
333
## XSRF/CSRF and Razor Pages
334
334
335
-
Razor Pages are protected by[Antiforgery validation](xref:security/anti-request-forgery). The [FormTagHelper](xref:mvc/views/working-with-forms#the-form-tag-helper) injects antiforgery tokens into HTML form elements.
335
+
Razor Pages are protected by[Antiforgery validation](xref:security/anti-request-forgery). The [FormTagHelper](xref:mvc/views/working-with-forms#the-form-tag-helper) injects antiforgery tokens into HTML form elements.
336
336
337
337
<aname="layout"></a>
338
338
339
339
## Using Layouts, partials, templates, and Tag Helpers with Razor Pages
340
340
341
-
Pages work with all the capabilities of the Razor view engine. Layouts, partials, templates, Tag Helpers, *_ViewStart.cshtml*, *_ViewImports.cshtml* work in the same way they do for conventional Razor views.
341
+
Pages work with all the capabilities of the Razor view engine. Layouts, partials, templates, Tag Helpers, *_ViewStart.cshtml*, and *_ViewImports.cshtml* work in the same way they do for conventional Razor views.
342
342
343
343
Let's declutter this page by taking advantage of some of those capabilities.
344
344
@@ -352,7 +352,7 @@ The [Layout](xref:mvc/views/layout):
352
352
* Imports HTML structures such as JavaScript and stylesheets.
353
353
* The contents of the Razor page are rendered where `@RenderBody()` is called.
354
354
355
-
For more information, see [layout page](xref:mvc/views/layout)..
355
+
For more information, see [layout page](xref:mvc/views/layout).
356
356
357
357
The [Layout](xref:mvc/views/layout#specifying-a-layout) property is set in *Pages/_ViewStart.cshtml*:
358
358
@@ -470,7 +470,7 @@ For more information, see <xref:mvc/controllers/areas> and <xref:razor-pages/raz
470
470
471
471
## ViewData attribute
472
472
473
-
Data can be passed to a page with <xref:Microsoft.AspNetCore.Mvc.ViewDataAttribute>. Properties with the [ViewData] attribute have their values stored and loaded from the <xref:Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary>.
473
+
Data can be passed to a page with <xref:Microsoft.AspNetCore.Mvc.ViewDataAttribute>. Properties with the `[ViewData]` attribute have their values stored and loaded from the <xref:Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary>.
474
474
475
475
In the following example, the `AboutModel` applies the `[ViewData]` attribute to the `Title` property:
476
476
@@ -523,7 +523,7 @@ The *Pages/Customers/Index.cshtml.cs* page model applies the `[TempData]` attrib
523
523
publicstringMessage { get; set; }
524
524
```
525
525
526
-
For more information, see [TempData](xref:fundamentals/app-state#tempdata).
526
+
For more information, see [TempData](xref:fundamentals/app-state#tempdata).
527
527
528
528
<aname="mhpp"></a>
529
529
@@ -575,7 +575,7 @@ To configure advanced options, use the extension method <xref:Microsoft.Extensio
575
575
576
576
Use the <xref:Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions> to set the root directory for pages, or add application model conventions for pages. For more information on conventions, see [Razor Pages authorization conventions](xref:security/authorization/razor-pages-authorization).
577
577
578
-
To precompile views, see [Razor view compilation](xref:mvc/views/view-compilation).
578
+
To precompile views, see [Razor view compilation](xref:mvc/views/view-compilation).
579
579
580
580
### Specify that Razor Pages are at the content root
0 commit comments