1.mvcオープンhtmlコード
バックグラウンド処理:
/// <要約> /// 回復HTML特殊文字 /// </要約> /// <paramNameに= "theString"> テキストを復元する必要があります。</ param>の/// <返します> 良いテキストを復元します。</戻り> パブリック静的文字列 HtmlDiscode(文字theString) { theString = theString.Replace(" &GT; "、" > " ); theString = theString.Replace(" &LT; "、" < " ); theString = theString.Replace(" &NBSP; "、" " ); theString = theString.Replace(" &QUOT; "、" \" " ); theString = theString.Replace(" &#39; " " \」" ); theString = theString.Replace(" <BR/> " " \ n " ); 戻りtheStringを; }
フロントページ:
@ Html.Raw(ViewBag.content)