From 932e9608a1bd1f2df8ff1185c390ffd540791b70 Mon Sep 17 00:00:00 2001 From: Fiyaz Bin Hasan Date: Thu, 7 Oct 2021 23:32:18 +0600 Subject: [PATCH] doc update for anchor tag helper (#23480) --- aspnetcore/mvc/views/tag-helpers/built-in/anchor-tag-helper.md | 2 +- .../samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aspnetcore/mvc/views/tag-helpers/built-in/anchor-tag-helper.md b/aspnetcore/mvc/views/tag-helpers/built-in/anchor-tag-helper.md index 50727220a5..fd227af4c6 100644 --- a/aspnetcore/mvc/views/tag-helpers/built-in/anchor-tag-helper.md +++ b/aspnetcore/mvc/views/tag-helpers/built-in/anchor-tag-helper.md @@ -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*: diff --git a/aspnetcore/mvc/views/tag-helpers/built-in/samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs b/aspnetcore/mvc/views/tag-helpers/built-in/samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs index 4d47381db5..bea4cb4945 100644 --- a/aspnetcore/mvc/views/tag-helpers/built-in/samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs +++ b/aspnetcore/mvc/views/tag-helpers/built-in/samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs @@ -7,6 +7,7 @@ public class SpeakerController : Controller { + #region snippet_SpeakerDetailAction private List Speakers = new List { @@ -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")]