Skip to content

Instantly share code, notes, and snippets.

@shengoo
Created April 24, 2014 02:25
Show Gist options
  • Save shengoo/11239395 to your computer and use it in GitHub Desktop.
Save shengoo/11239395 to your computer and use it in GitHub Desktop.
输出HTML代码(包含标签):直接输出,
string html = "<font color='red'>文本</font>"; @html
输出HTML内容(不包含标签):有两种方法,
第一种:
IHtmlString html=new HtmlString("<font color='red'>文本</font>");@html ;
第二种:
string html = "<font color='red'>文本</font>"; @Html.Raw(html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment