MVC使用方法
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;} View Code前臺頁面:
@Html.Raw(ViewBag.content) View Code?
轉載于:https://www.cnblogs.com/chenze-Index/p/10980732.html
總結
- 上一篇: 用函数式编程,从0开发3D引擎和编辑器(
- 下一篇: C++ | 内联函数 inline