I want to replace
X
withglyphicon-trash
.
I am using X
as a linktext.Which works for deleting an item.How to replace with a glyphicon.
Here is my code
@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');"})
You can do it like following. Just add @class = "glyphicon glyphicon-trash"
in htmlAttributes
parameter and replace X
with a 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" })