更新时间:2023-01-07 08:13:45
您需要使用htmlAttributes匿名对象,像这样的:
you need to use the htmlAttributes anonymous object, like this:
<%= Html.ActionLink("linky", "action", "controller", new { onclick = "someFunction();"}) %>
您也可以给它一个ID的重视它与jQuery /不管,像这样的:
you could also give it an id an attach to it with jquery/whatever, like this:
<%= Html.ActionLink("linky", "action", "controller", new { id = "myLink" }) %>
$('#myLink').click(function() { /* bla */ });