Had some trouble today with *.Attributes.Add and using an ampersand &.
The problem is Attributes.Add and here's what I found:
Using Reflector to trace through System.Web.UI.WebControlsWebControl.Attributes to see if it was doing any kind of encoding turns out thatLameness I say! Anyways the solution I used was to register a startup script and place my onClick in a function then on my attributes.add I just call the javascript function. Works well, and note that this happened to me on ASP.NET 1.1, not sure if it occurs in 2.0
System.Web.HttpUtility.HtmlAttributeEncode is called on any text added via Attributes.Add. HtmlAttributeEncode turns & into& and turns double quotes (") into"
No comments:
Post a Comment