Update index.md (#11290)

* Update index.md

* Update index.md

* Update aspnetcore/razor-pages/index.md

Co-Authored-By: Rick-Anderson <riande@microsoft.com>
pull/11309/head
Rick Anderson 2019-03-05 14:17:24 -10:00 committed by GitHub
parent 8b30eba931
commit 862a7e5099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -168,7 +168,7 @@ The *Index.cshtml* file contains the following markup to create an edit link for
[!code-cshtml[](index/sample/RazorPagesContacts/Pages/Index.cshtml?range=21)]
The [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, `http://localhost:5000/Edit/1`.
The [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, `http://localhost:5000/Edit/1`. Use the `asp-area` attribute to specify an area. For more information, see <xref:mvc/controllers/areas>.
The *Pages/Edit.cshtml* file:
@ -396,6 +396,14 @@ Relative name linking is useful when building sites with a complex structure. If
::: moniker range=">= aspnetcore-2.1"
To redirect to a page in a different [Area](xref:mvc/controllers/areas), specify the area:
```csharp
RedirectToPage("/Index", new { area = "Services" });
```
For more information, see <xref:mvc/controllers/areas>.
## ViewData attribute
Data can be passed to a page with [ViewDataAttribute](/dotnet/api/microsoft.aspnetcore.mvc.viewdataattribute). Properties on controllers or Razor Page models decorated with `[ViewData]` have their values stored and loaded from the [ViewDataDictionary](/dotnet/api/microsoft.aspnetcore.mvc.viewfeatures.viewdatadictionary).
@ -542,7 +550,7 @@ services.AddMvc()
* <xref:index>
* <xref:mvc/views/razor>
* <xref:mvc/controllers/areas#areas-with-razor-pages>
* <xref:mvc/controllers/areas>
* <xref:tutorials/razor-pages/razor-pages-start>
* <xref:security/authorization/razor-pages-authorization>
* <xref:razor-pages/razor-pages-conventions>