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"))
這可能嗎?