string str = "<div>aaa</div>"; this.Literal1.Text = string.Format("<pre>{0}</pre>", str.Replace("<", "<").Replace(">", ">"));
string str = "<div>中国</div>"; this.Literal1.Text = Server.HtmlEncode(str);
在网页中显示html代码
时间: 2024-10-19 21:10:45
string str = "<div>aaa</div>"; this.Literal1.Text = string.Format("<pre>{0}</pre>", str.Replace("<", "<").Replace(">", ">"));
string str = "<div>中国</div>"; this.Literal1.Text = Server.HtmlEncode(str);
在网页中显示html代码