How do I stop server control attributes being HTML encoded?

Posted by Billious on Stack Overflow See other posts from Stack Overflow or by Billious
Published on 2010-03-19T01:32:25Z Indexed on 2010/03/19 1:41 UTC
Read the original article Hit count: 257

Filed under:

I'm trying to alter the onmouseover attribute of a HyperLink server control, but when I do so the JavaScript call I'm entering gets HTML encoded. For example:

linkBooks.Attributes("onmouseover") = "changeImages(""books"", ""/images/common/books-dark.png""); return true;"

Gets converted to:

onmouseover="changeImages("books", "/images/common/books-dark.png"); return true;"

How do I prevent this? The same code worked fine under VS2005 and .NET 2.0, I'm currently using VS2010RC and .NET 4.0.

© Stack Overflow or respective owner

Related posts about ASP.NET