.Net 4.0 is encoding single quotes when I am using Attributes.Add to add client side events to my asp.net objects. In the previous versions this didn't happen.
for example :
<asp:Image runat="server" ID="imgTest" ImageUrl="~/DateControl/cal.gif" />
imgTest.Attributes.Add("onmouseover", "alert('Hello')");
When I view the client side output, I am getting
<img id="ctl00_MainContent_calFromTimeStamp1_imgTest" onmouseover="alert('Hello')" src="../DateControl/cal.gif" style="border-width:0px;" />
I found a workaround by creating a custom encoder : creating custom encoding routines but I don't want to stop the encoding for the whole website just because of this issue. Anybody got a workaround or an idea of how to fix this?