While doing something very rudimentary: adding dynamic tags to some ASP.NET pages for SEO purposes (title, description, keywords, etc ... you know ... the usual suspects), the dynamically created controls were malformed in the following ways
- the <meta> tags had no trailing "/".
- <meta name="description" content="some content"> should be <meta name="description" content="some content" />
- A coworker tried to set the content attribute inline like this: <meta name="description" content="<%=contentvar%>" /> and the generated code looked like this
- <meta name="description" content=">%=contentvar%>">
- notice the <% token get interpreted as HTML and replaced with the encoding for greater than.
- also notice the trailing "/" still gets removed even though it's clearly written into the aspx file
It was by pure chance that I noticed the following line of code in my web.config.
- <xhtmlConformance mode="Legacy"/>
It turns out Visual Studio puts this line of code in your web.config for you when migrating from VS 2003 to VS 2005. This was quite a while ago as we've been on Vs 2008 for quite some time now.
Removing that line fixed the problem, now I simply have to regression test the entire site to see if removing that line breaks something else. Greeeaat.
Here is a link to Scott Gu's blog post that is related and helpful, but does not address my exact issues:
df8409be-aee9-432f-80c8-6483f4d6cd5c|1|5.0