.NET 3.5 and HTMLEncoding on ASP.NET Controls

Watch out if you use Gridviews which display links or specific HTML in some columns. Since I upgraded to the .NET Framework 3.5 on my servers my Gridviews had HTMLEncoding turned on by default.

So you have to turn it off now manually via HtmlEncodeFormatString=”False”. I didn’t notice that at first but a customer quickly reported the missing links in the Gridview – the columns displayed plain HTML Text instead of a link.

Just fyi..

3 comments ↓

#1 Jesper on 08.01.07 at 12:05 am

Thanks, that’s useful to know about.

#2 Loic Bar on 08.11.07 at 3:41 pm

I installed framework 3.5 and I don’t have any HtmlEncodeFormatString properties in my gridview. Is it normal? Where do you put this properties?

#3 NuJoizey on 02.27.08 at 10:02 pm

I just noticed this to be true. I ported my app over to a new test server set up by our IT department only to find that this little attribute being turned on by default was really mucking up the works by displaying html div tags that contained css information all over my UI. So far I can’t find a way to make it go away other than just to go into each page and correct this manually. My old VS development environment did not present this attribute as an option, yet it does in the new one, so I can only attribute the difference to some sort of framework configuration difference

Leave a Comment