commit
44a62f59d4
|
@ -112,6 +112,7 @@ Here's a sample `aspNetCore` element that configures `stdout` logging. The `stdo
|
|||
stdoutLogFile="\\?\%home%\LogFiles\stdout">
|
||||
</aspNetCore>
|
||||
```
|
||||
See [Configuration via web.config](#configuration-via-webconfig) for an example of the `aspNetCore` element in the *web.config* file.
|
||||
|
||||
## ASP.NET Core Module with an IIS Shared Configuration
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ description: Shows how to work with Anchor Tag Helper
|
|||
keywords: ASP.NET Core,tag helper
|
||||
ms.author: riande
|
||||
manager: wpickett
|
||||
ms.date: 02/14/2017
|
||||
ms.date: 12/20/2017
|
||||
ms.topic: article
|
||||
ms.assetid: c045d485-d1dc-4cea-a675-46be83b7a011
|
||||
ms.technology: aspnet
|
||||
|
@ -43,7 +43,6 @@ The generated markup will be:
|
|||
|
||||
If the `asp-controller` is specified and `asp-action` is not, the default `asp-action` will be the default controller method of the currently executing view. That is, in the above example, if `asp-action` is left out, and this Anchor Tag Helper is generated from *HomeController*'s `Index` view (**/Home**), the generated markup will be:
|
||||
|
||||
|
||||
```html
|
||||
<a href="/Home">All Speakers</a>
|
||||
```
|
||||
|
@ -66,6 +65,33 @@ If no `asp-controller` attribute is specified, the default controller calling th
|
|||
|
||||
If the attribute `asp-action` is `Index`, then no action is appended to the URL, leading to the default `Index` method being called. The action specified (or defaulted), must exist in the controller referenced in `asp-controller`.
|
||||
|
||||
### asp-page
|
||||
|
||||
Use the `asp-page` attribute in an anchor tag to set its URL to point to a specific page. Prefixing the page name with a forward slash "/" creates the URL. The URL in the sample below points to the "Speaker" page in the current directory.
|
||||
|
||||
```cshtml
|
||||
<a asp-page="/Speakers">All Speakers</a>
|
||||
```
|
||||
|
||||
The `asp-page` attribute in the previous code sample renders HTML output in the view that is similar to the following snippet:
|
||||
|
||||
```html
|
||||
<a href="/items?page=%2FSpeakers">Speakers</a>
|
||||
``
|
||||
|
||||
The `asp-page` attribute is mutually exclusive with the `asp-route`, `asp-controller`, and `asp-action` attributes. However, `asp-page` can be used with `asp-route-id` to control routing, as the following code sample demonstrates:
|
||||
|
||||
```
|
||||
cshtml<a asp-page="/Speaker" asp-route-id="@speaker.Id">View Speaker</a>
|
||||
```
|
||||
|
||||
The `asp-route-id` produces the following output:
|
||||
|
||||
```html
|
||||
https://localhost:44399/Speakers/Index/2?page=%2FSpeaker
|
||||
```
|
||||
|
||||
|
||||
### asp-route-{value}
|
||||
|
||||
`asp-route-` is a wild card route prefix. Any value you put after the trailing dash will be interpreted as a potential route parameter. If a default route is not found, this route prefix will be appended to the generated href as a request parameter and value. Otherwise it will be substituted in the route template.
|
||||
|
|
|
@ -5,13 +5,13 @@ description: Getting started with Razor Pages in ASP.NET Core
|
|||
keywords: ASP.NET Core,Razor Pages,Razor,MVC
|
||||
ms.author: riande
|
||||
manager: wpickett
|
||||
ms.date: 08/27/2017
|
||||
ms.date: 12/22/2017
|
||||
ms.topic: get-started-article
|
||||
ms.technology: aspnet
|
||||
ms.prod: aspnet-core
|
||||
uid: tutorials/razor-pages/razor-pages-start
|
||||
---
|
||||
# Getting started with Razor Pages in ASP.NET Core
|
||||
# Get started with Razor Pages in ASP.NET Core
|
||||
|
||||
By [Rick Anderson](https://twitter.com/RickAndMSFT)
|
||||
|
||||
|
@ -35,7 +35,11 @@ There are three versions of this tutorial:
|
|||
* Create a new ASP.NET Core Web Application. Name the project **RazorPagesMovie**. It's important to name the project *RazorPagesMovie* so the namespaces will match when you copy/paste code.
|
||||
![new ASP.NET Core Web Application](../../mvc/razor-pages/index/_static/np.png)
|
||||
* Select **ASP.NET Core 2.0** in the dropdown, and then select **Web Application**.
|
||||
![Web Application (Razor Pages)](../../mvc/razor-pages/index/_static/np2.png)
|
||||
|
||||
> [!NOTE]
|
||||
> If you want to use ASP.NET Core on the .NET Framework, you must first select **.NET Framework** from the leftmost dropdown in the dialog, then you can select the desired ASP.NET Core version.
|
||||
|
||||
![Web Application (Razor Pages)](razor-pages-start/_static/np2.png)
|
||||
|
||||
The Visual Studio template creates a starter project:
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 104 KiB |
Loading…
Reference in New Issue