I have an issue in asp.net 4.
When I add an attribute on controls, then the render it encoded.
For example, when I type this code
From MSDN WebControl.Attributes Property Documentation...
Note
You cannot add client-side script to a WebControl instance using the Attributes collection. To add client-side script, use the ClientScript property on the Page control.
The problem is that Attributes expects data if it's being set in the code-behind.
The solution is to send back a client script with your client side handler functions then you may set the attribute with the name of your functions.
If your javascript is static, then things are even simpler, since you can send them in a script tag long before the controls are registered.