I have a GridView bound to an ObjectDataSource. I\'ve got it supporting editing as well, which works just fine. However, I\'d like to safely HtmlEncode text that is displa
This is now possible to do using the new HTML encoding databinding syntax introduced in ASP.NET 4.
You can simply use:
<%#: Eval("MyField") %>
Or
<%#: Bind("MyField") %>
Note the colon after the pound/hash sign It's as simple as that.