ASPCoder1450
ASPCoder1450

Reputation: 1651

Use a Span Class with @HTML Raw Links

I have this code:

 string tag = "<td> <a href="+ path + ">" + "<span class=glyphicon glyphicon-trash" + ">" + "</span>" + "</a>" + "</td>";
 }
 @Html.Raw(tag)

Nothing appears when I tried to use the glyphicon icon. Am i missing any syntax to use the span class in this instance?

Upvotes: 1

Views: 1040

Answers (1)

Frederik Spang
Frederik Spang

Reputation: 3454

You'll need to wrap the class value and href value in quotes too, as far as I know.:

 string tag = "<td> <a href='" + path + "'>" + "<span class='glyphicon glyphicon-trash'" + ">" + "</span>" + "</a>" + "</td>";

Upvotes: 3

Related Questions