Как передать Guid?
< strong>TagHelper:
Код: Выделить всё
[HtmlTargetElement("assets:signin", Attributes = "profile", TagStructure = TagStructure.NormalOrSelfClosing)]
public sealed class GoToSignInTagHelper(IWebHostEnvironment environment, IHtmlHelper html, ITagHelperRepo helperRepo, IUtilityHelper helpUtil) : TagHelperCustom(environment, helperRepo, html)
{
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
await base.PreProcessAsync(context, output);
ITagBuilderCustom link = new TagBuilderCustom("a");
link.AddAttribute("href", $"{CoreStatics.AssetsURL}/SignIn?uid={this.Profile}");
AddContent(link);
await base.ProcessAsync();
}
[HtmlAttributeName("profile")]
public Guid Profile { get; set; }
}
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/787 ... p-net-core