Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Young 19 posts 39 karma points
    Apr 18, 2012 @ 10:50
    Phil Young
    0

    @inherits RenderViewPage causes QUIRKS mode in browser

    Hi there,

    I've started to build my first Umbraco 5 site, and have hit upon a problem/bug that I cant figure out the fix for.

    Inside my _Layout.cshtml file, i'm using @inherits RenderViewPage at the top like so:

    @inherits RenderViewPage
    <!doctype html>
    <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
    <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
    <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
    <title>@Umbraco.Field("title")</title>
    </head>

    Without @inherits RenderViewPage at the top of the page, it was causing an error on the @Umbraco.Field("title") part. Adding it causes the page to work as expected, however it causes the browser to drop into Quirks mode.

    When looking at the served HTML, I can see that it's done this which is causing the quirks mode to kick in:

    <!doctype html> <--- see the extra whitespace to the left of the doctype declaration causing the quirks mode.
    <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
    <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
    <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
    <title>foo</title>

    Is this a known error or am I doing this the wrong way? Is there a bug fix?

     

    Many thanks in advance, Phil

     

     

Please Sign in or register to post replies

Write your reply to:

Draft