简体   繁体   中英

Where is htmlAttribute at ASP.NET Core <a>?

I would like to insert htmlAttribute to the following code

<a asp-action="MyTestAction" asp-controller="Home" asp-route-myid1="a" asp-route-myid2="b">Test</a>

as there is at @Html.ActionLink :

在此处输入图片说明

You are using a tag helper.

With tag helpers, you insert attributes directly into the view body as raw HTML attributes:

<a asp-action="MyTestAction"
   asp-controller="Home"
   asp-route-myid1="a"
   asp-route-myid2="b"
   class="foo"
   disabled
   data-whatever="@razor_expression">Test</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM