在 ASP.NET MVC 的最新 (RC1) 版本中,如何让 Html.ActionLink 呈现为按钮或图像而不是链接?
延迟响应,但您可以保持简单并将 CSS 类应用于 htmlAttributes 对象。
<%= Html.ActionLink("Button Name", "Index", null, new { @class="classname" }) %>
然后在您的样式表中创建一个类
a.classname { background: url(../Images/image.gif) no-repeat top left; display: block; width: 150px; height: 150px; text-indent: -9999px; /* hides the link text */ }