-----如何改变部分文字的背景色----
在服务器端通过判断找到一段文字中需要改变颜色的字符串,
if (model.request_content.Contains(“要改变颜色的字符”))
{
tmp = "<div><span style='color:green'>" + “要改变颜色的字符” + "</span></div>";
newContent = model.request_content;
newContent = newContent.Replace(rep, tmp);
model.request_content = newContent;
}
在客户端代码解析不了
<div class="control-group">
<label class="control-label">内容</label>
<div class="controls">
@Model.request_content
</div>
</div>
“<div><span style='color:green'>",
把它当成字符串显示出来了,请问应该如何实现?