ASP.NET single quotes are converted to '
We had the same issue with single quotes in attribute values when we migrated a project from .NET 3.5 to .NET 4.0. It converts all single quotes in attribute values to &39;
. So we went back to .NET 3.5.
It's a .NET 4.0 thing. You can read more about this issue here.