如果使用Label的话,可以先对字符进行Html编码:label1.text=Server.HtmlEncode(string);如果使用Literal的话,可以将它的Mode属性设为:Encode,然后Literal1.text=string;