Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using HTML 5 specific markup () in my modified mobile dispform.aspx page (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MOBILE\dispform.aspx). In order for some of the browsers to correctly parse and interpret the content, I need to add the

<!DOCTYPE HTML>

as the first line of the response stream. How can I accomplish this?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The parent SPMobilePage has a Response property which can be used to directly inject markup into the response stream.

So in this case in my OnLoad() method is simply find the parent and then add the processing instruction markup:

   protected override void OnLoad(EventArgs e)
   {
        base.OnLoad(e);

        SPMobilePage parent = this.Parent.Parent as SPMobilePage;
        parent.Response.Write("<!DOCTYPE HTML>");
        ...
   }
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.