views:

306

answers:

2

We use master pages in our web application, and the doctype is defined in the master page. On one of the pages I need to change the doctype, or else a third-party control renders incorrectly.

How can I change the doctype of only that certain page, without affecting the rest of the pages?

A: 

I don't know if it would work but

You can reset the content type with

Response.Clear();
Response.ContentType = "text/html";

Then write your doctype type

Response.Write(<new doc-type>);

But you will also loose all meta headers and such, you're probably better off with the other solution provided by Chris Lively...

Mike Gleason jr Couturier
+4  A: 

By far the simplest way is to make another copy of your master page, change the doctype in that and have this page use the new master.

Chris Lively