views:

56

answers:

2

I'm having the problem described here, which is caused by using , when the page being served has content type "text/html" instead of "application/xhtml+xml".

Where can I switch VS2010's web server configuration to serve XHTML?

+1  A: 

All the built-in ASP.NET MVC HTML helpers always render XHTML markup. There is no way to configure what kind of markup they render. You can always write your own helpers that render different markup. You can take a look at the source code for ASP.NET MVC to see how the helpers are implemented:

Eilon
My (development, not production) server is serving the content as HTML (content type = "text/html"). I *want* XHTML. Where can I configure the Visual Studio 2010 dev server to serve XHTML?
ripper234
A: 

Internet Explorer doesn't understand the application/xhtml+xml content-type so that's probably the reason why the webserver serves all xhtml as html. You can override the web server's setting by including the xhtml content-type in a meta tag.

<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />
ZippyV
You have it backwards. Real HTTP headers trump HTTP-EQUIV every day of the week.
David Dorward