Reputation: 25
I have a column called LastName
in a GridView and it is pulling data correctly; however, people whose last names include an apostrophe '
, like O'Connor, it shows up as O'Connor
. How do I make it show an apostrophe and not a code? I am aware of a code System.Net.WebUtility.HtmlEncode(TEXT to ENCODE)
which fixes such issue but I do not know how to apply it to the BoundField or if it will work in the BoundField? Please help.
<asp:BoundField DataField="LastName" HeaderText="Last Name"
SortExpression="LastName" />
Upvotes: 1
Views: 1119