开发者

HtmlEncode text in DetailsView in ASP.NET

开发者 https://www.devze.com 2023-03-20 15:24 出处:网络
I开发者_运维百科 have taken over a project where HtmlDecode has been run on all data in the database. I will now use the asp:DetailsView to edit the data. The problem is that the asp:BoundField does n

I开发者_运维百科 have taken over a project where HtmlDecode has been run on all data in the database. I will now use the asp:DetailsView to edit the data. The problem is that the asp:BoundField does not encode the data so that it appears correctly in edit mode. How do I solve that?


You should be able to set the HtmlEncode property on the asp:Boundfield to true. When this property is set to true, the data will be encoded before it appears.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.htmlencode.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号