string str = "<div>aaa</div>";
this.Literal1.Text = string.Format("<pre>{0}</pre>", str.Replace("<", "&lt;").Replace(">", "&gt;"));
string str = "<div>中国</div>";
this.Literal1.Text = Server.HtmlEncode(str);

在网页中显示html代码的更多相关文章

  1. 在网页中显示CHM (c# csharp .net asp.net winform)

    CHM即“已编译的帮助文件”,主要由.hhc(目录文件)..hhk(索引文件)以及相应的帮助主题文件(.html,.htm)这些内容编译而成. 方法对比 在网页中显示CHM内容,大致有以下几种办法: ...

  2. 网页中显示pdf

    1.<embed width="800" height="600" src="test_pdf.pdf"> </embed ...

  3. 非常好的在网页中显示pdf的方法

    今天有一需求,要在网页中显示pdf,于是立马开始搜索解决方案,无意中发现一个非常好的解决方法,详见http://blogs.adobe.com/pdfdevjunkie/web_designers_g ...

  4. 网页中显示pdf的方法

    非常好的在网页中显示pdf的方法 今天有一需求,要在网页中显示pdf,于是立马开始搜索解决方案,无意中发现一个非常好的解决方法,详见http://blogs.adobe.com/pdfdevjunki ...

  5. 网页中显示xml,直接显示xml格式的文件

    第一种方法 使用<pre></pre>包围代码(在浏览器中测试不行啊,但是在富编辑器中又可以,怪):使用<xmp></xmp>包围代码(官方不推荐,但是 ...

  6. 使用<script>标签在HTML网页中插入JavaScript代码

    新朋友你在哪里(如何插入JS) 我们来看看如何写入JS代码?你只需一步操作,使用<script>标签在HTML网页中插入JavaScript代码.注意, <script>标签要 ...

  7. Flash设置全屏后,放到网页中显示不正常

    stage.displayState = StageDisplayState.FULL_SCREEN;//全屏,注意当设置全屏后,放到网页中显示不正常

  8. Emoji表情在网页中显示

    最近遇到一个项目,客户手机上发送的表情要在电脑网页中显示,没有找到简便方法,于是有了以下方案. 由于Emoji表情传到后台是“口”,怎么找出接收数据中的表情是关键,各种搜索后,我用下面的正则表达式匹配 ...

  9. 如何在浏览器网页中显示word文件内容

    如何在浏览器网页中显示word文件内容 把word文件读到byte[]中,再Response.OutputStream.Write(bytes)到客户端去 Page_Load事件中写: //FileS ...

随机推荐

  1. jq隐藏页面的一行

    <script type="text/javascript" src="http://files.cnblogs.com/914556495wxkj/jquery- ...

  2. javax.imageio.IIOException: Can't create cache file!

    javax.imageio.IIOException: Can't create cache file! at javax.imageio.ImageIO.createImageInputStream ...

  3. ios7 上 UIActivity 用的image

    在ios8 上UIActivityCategoryShare类型的UIActivity的图标支持彩色图片了,但是在ios7上不行,ios8上的 UIActivityCategoryAction类型也不 ...

  4. serv-u启动管理控制台后提示脚本错误解决方案

             问题描述: 安装serv-u后打开管理控制台,提示“脚本错误“控制台界面无法正常显示: 解决方法: 1.在serv-u安装目录下找到”Serv-U-DefaultCertificat ...

  5. CodeSnippetsLibrary的使用方法

    在项目开发中,我们经常可以看到如下所示的代码: @property (nonatomic, copy) NSString *isbatchapprove; @property (nonatomic,  ...

  6. modelsim do文件仿真

    1.编写sim.do文件 ##### Quit the Simulation ##### quit -sim   ##### Make work directory && Create ...

  7. js闭包问题

    function picLinkInit(parentClassName, imgW, imgH, childClassObjs) { var $match = $(parentClassName); ...

  8. apache vhost

    httpd.conf: Include "F:/wamp/alias/*" <Directory "F:\wamp\www">    Options ...

  9. Apple Swift编程语言入门教程

    Apple Swift编程语言入门教程 作者: 日期: 布衣君子 2015.09.22 目录 1   简介 2   Swift入门 3   简单值 4   控制流 5   函数与闭包 6   对象与类 ...

  10. 20.策略者模式(Stragety Pattern)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...