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);

 

相关文章: