label怎么显示text而不是HTML格式

2025-04-10 19:31:27
推荐回答(1个)
回答1:

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