locked
Cannot display ActionLink as icon RRS feed

  • Question

  • User657329123 posted

    Hello,

    In my view, I have following. I'm trying to display an icon instead of text link but I don't see icon. What am I doing wrong?

    @Html.ActionLink(" X ", "ActionName","ControllerName", new { id = Model.Id, fileId = file.ReceiptId }, new { @title = "Delete", @class = "glyphicon glyphicon-trash" })

    Joe

    Thursday, December 17, 2020 3:24 PM

All replies

  • User475983607 posted

    Hello,

    In my view, I have following. I'm trying to display an icon instead of text link but I don't see icon. What am I doing wrong?

    @Html.ActionLink(" X ", "ActionName","ControllerName", new { id = Model.Id, fileId = file.ReceiptId }, new { @title = "Delete", @class = "glyphicon glyphicon-trash" })

    Joe

    You are not following the syntax found in the reference documentation.  

    https://getbootstrap.com/docs/3.3/components/#glyphicons-examples

    Use HTML rather than an Action link.  The font icons expects an inline tag like a <span>.

    Thursday, December 17, 2020 4:15 PM