gpt4 book ai didi

asp.net - 如何用 @Html.ActionLink 中的字形替换 actionlink 文本?

转载 作者:行者123 更新时间:2023-12-02 05:48:50 27 4
gpt4 key购买 nike

I want to replace X with glyphicon-trash.

我正在使用 X 作为链接文本。这适用于删除项目。如何用字形替换。

这是我的代码

 @Html.ActionLink(
"X",
"Delete",
"Grocery",
new { GroceryUsageID = item.GroceryUsageID, GroceryId = item.GroceryID },
new { @onclick = "return confirm('Are you sure you want to delete this Grocery');"})

最佳答案

你可以像下面那样做。只需在 htmlAttributes 参数中添加 @class = "glyphicon glyphicon-trash" 并将 X 替换为 space

 @Html.ActionLink(
" ",
"Delete",
"Grocery",
new { GroceryUsageID = item.GroceryUsageID, GroceryId = item.GroceryID },
new { @onclick = "return confirm('Are you sure you want to delete this Grocery');",
@class = "glyphicon glyphicon-trash" })

关于asp.net - 如何用 @Html.ActionLink 中的字形替换 actionlink 文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34604933/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com