View _ViewImports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@addTagHelper *, TagHelperSuite |
View Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form asp-page-handler="Post"> | |
<link-button>Test Link</link-button> | |
</form> |
View Default.aspx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:LinkButton ID="lbtnSubmit" runat="server" PostBackUrl="~/About.aspx" Text="Submit Form" /> |
View Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post"> | |
<button asp-page="/Index" asp-page-handler="Post">Submit Form</button> | |
</form> |
View Index.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IndexModel : PageModel | |
{ | |
public void OnGet() | |
{ | |
} | |
public void OnPost() | |
{ | |
} | |
} |
View CardTagHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fetch the context, so that we can add the Card object to the Cards collection | |
var handContext = (HandContext)context.Items[typeof(HandTagHelper)]; | |
handContext.Cards.Add(new Card { Rank = rank, Suit = suit }); |
View HandContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HandContext | |
{ | |
public List<Card> Cards { get; set; } = new List<Card>(); | |
} |
View _Card.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model TagHelpersDemo.Views.Shared.Partials.CardViewModel | |
<img src="images/@(Model.PlayerName).png" alt="avatar" class="center-block" /> | |
<div class="text-center"> | |
<h2 class="@Model.SuitColorClass"> | |
<strong>@Html.Raw(Model.SuitCharacterCode)</strong> | |
</h2> | |
<p>@Model.Rank</p> | |
</div> |
View CardTagHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content = await _html.PartialAsync("~/Views/Shared/Partials/_Card.cshtml", model); | |
output.Content.SetHtmlContent(content); |
NewerOlder