Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用带有@HTML原始链接的Span类_Html_Asp.net Mvc_Twitter Bootstrap - Fatal编程技术网

使用带有@HTML原始链接的Span类

使用带有@HTML原始链接的Span类,html,asp.net-mvc,twitter-bootstrap,Html,Asp.net Mvc,Twitter Bootstrap,我有以下代码: string tag = "<td> <a href="+ path + ">" + "<span class=glyphicon glyphicon-trash" + ">" + "</span>" + "</a>" + "</td>"; } @Html.Raw(tag) string tag=“”+”; } @Html.Raw(标记) 当我尝试使用glyphicon图标时,没有显示任何内容。我是

我有以下代码:

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

当我尝试使用glyphicon图标时,没有显示任何内容。我是否缺少在此实例中使用span类的语法

据我所知,您还需要将class值和href值用引号括起来:

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

你在代码块的开头有
@{
吗?是的,我有。当我只使用纯文本作为链接值时,它确实起作用