您的位置:首页 > 理论基础 > 计算机网络

在用HttpUtility.HtmlDecode转义成html画面显示的时候遇到的奇怪问题

2012-03-29 15:18 344 查看
画面html代码显示

@{

DataTable dtReturn= (DataTable)ViewBag.DtReturnInfo;

}

@{

if (dtReturnInfo.Rows.Count > 0)

{

for (int i = 0; i < dtReturnInfo.Rows.Count; i++)

{

<div class="divContent">

<p style="margin-left:10px;" class="REPLY_CONTENT" title="@HttpUtility.HtmlDecode(dtReturn.Rows[i]["REPLY_CONTENT"].ToString())"></p>

</div>

}

}

}

javascript脚本

$(".divContent").each(function () {

$(this).find(".REPLY_CONTENT").html($(this).find(".REPLY_CONTENT").attr("title"));

})

给P标签赋值的时候必须用该标签的属性才可以把html代码在画面上正常显示。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐