Search code examples
asp.netwebformscontent-typexhtml-1.0-strict

How do you specify your Content Type in ASP.NET WebForms?


I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html. I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application


Solution

  • You can specify it in the @ page attributes section, like this:

    <%@ Page ContentType="application/xhtml+xm" %>
    

    ...more on MSDN.