MVCを使用してください

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)
コードの表示

 

おすすめ

転載: www.cnblogs.com/chenze-Index/p/10980732.html