2016-09-20 7 views
0

は私が@Html.ActionLinkに次のコードASP.NETコアのhtmlAttributeはどこですか<a>?

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

があるようにhtmlAttributeを挿入したいと思います:あなたは、タグヘルパーを使用している

enter image description here

答えて

2

。タグヘルパーで

生のHTML属性として、あなたは直接ビュー本体に属性を挿入します。

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