Tracy Gough Tracy Gough - 1 year ago 141
ASP.NET (C#) Question

Entity Framework BindItem renders HTML escape instead of apostophe

I am using the Entity Framework to maintain data for 4.5 application. Any data that has an apostrophe (single quote) in the data is rendered in the web form's textbox as HTML escape

. I have verified the data is stored as expected in the database correctly. For example: I store the value
in the database but when I want to edit the data the textbox is populated with
. The code I have in the web form to populate the textbox vlaue is this:


How can I make this render the data correctly without the HTML escape?

Answer Source

I found the answer to this. The syntax <%#: actually implicitly forces HTML encoding due to the colon :. I removed the colon and it works as expected.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download