1.mvc打开html代码
后台处理:
///<summary> ///恢复html中的特殊字符 ///</summary> ///<paramname="theString">需要恢复的文本。</param> ///<returns>恢复好的文本。</returns> public static string HtmlDiscode(string theString) { theString=theString.Replace(">",">"); theString=theString.Replace("<","<"); theString=theString.Replace(" "," "); theString=theString.Replace(""","\""); theString = theString.Replace("'", "\‘"); theString=theString.Replace("<br/>","\n"); return theString; }
前台页面:
@Html.Raw(ViewBag.content)
原文:https://www.cnblogs.com/chenze-Index/p/10980732.html