doc update for anchor tag helper (#23480)
parent
1b3a00f5c6
commit
932e9608a1
|
@ -64,7 +64,7 @@ The [asp-route-{value}](xref:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper
|
|||
|
||||
Consider the following controller action:
|
||||
|
||||
[!code-csharp[](samples/TagHelpersBuiltIn/Controllers/BuiltInTagController.cs?name=snippet_AnchorTagHelperAction)]
|
||||
[!code-csharp[](samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs?name=snippet_SpeakerDetailAction)]
|
||||
|
||||
With a default route template defined in *Startup.Configure*:
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
public class SpeakerController : Controller
|
||||
{
|
||||
#region snippet_SpeakerDetailAction
|
||||
private List<Speaker> Speakers =
|
||||
new List<Speaker>
|
||||
{
|
||||
|
@ -18,6 +19,7 @@
|
|||
[Route("Speaker/{id:int}")]
|
||||
public IActionResult Detail(int id) =>
|
||||
View(Speakers.FirstOrDefault(a => a.SpeakerId == id));
|
||||
#endregion
|
||||
|
||||
[Route("/Speaker/Evaluations",
|
||||
Name = "speakerevals")]
|
||||
|
|
Loading…
Reference in New Issue