首页 > Web开发 > 详细

MVC使用方法

时间:2019-06-05 17:31:00      阅读:97      评论:0      收藏:0      [点我收藏+]

1.mvc打开html代码

后台处理:

技术分享图片
  ///<summary>
        ///恢复html中的特殊字符
        ///</summary>
        ///<paramname="theString">需要恢复的文本。</param>
        ///<returns>恢复好的文本。</returns>
        public static string HtmlDiscode(string 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");
            return theString;
        }
View Code

前台页面:

技术分享图片
@Html.Raw(ViewBag.content)
View Code

 

MVC使用方法

原文:https://www.cnblogs.com/chenze-Index/p/10980732.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!