我有一个锚点按钮,其中包含链接信息和生成计数的模型。我需要链接为一种颜色,而 Model.Example 为不同的颜色。这可能吗?
请参阅代码示例。
.cshtml 中的链接
@Html.ActionLink("Example LinkText - (" + Model.Example + ")", "Example actionName", "Example controllerName", new { Model.ExampleID }, new { @class = "btn btn-add" })
控制器
public string Example => Count > 0 ? Count.ToString() : "";
提前致谢。
RISEBY
相关分类