4
我试图做这个问题的答案:ASP.NET MVC剃刀三元与HTML.ActionLink
How to use ternary operator in razor (specifically on HTML attributes)?
随着Html.ActionLink;像这样:
@(ViewData["page"] == "Page1" ? "Page1" : Html.ActionLink("Page 1", "Page1", "Index"))
这可能吗?