Copied to clipboard

Flag this post as spam?

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


  • Drew DeVault 22 posts 43 karma points
    Mar 16, 2012 @ 22:39
    Drew DeVault
    0

    Umbraco 5: Modified _Layout.cshtml Fails

    Here's my _Layout.cshtml file, with no Razor whatsoever:

    <!doctype html>
    <html lang="en-us">
    <head>
    <title>

    </title>
    <meta charset="UTF-8">
    <meta name="keywords" content="@DynamicModel.metaKeywords">
    <meta name="description" content="@DynamicModel.metaDescription">
    <link rel="stylesheet" href="/css/common.css" type="text/css"/>
    <link rel="stylesheet" href="/css/print.css" type="text/css" />
    <link rel="shortcut" href="/favicon.ico" />
    <meta name="viewport" content="width=1000"><meta name="msvalidate.01" content="194D2EF20B0B69290E8E8C59552A6559" />
    <link rel="icon" href="/favicon.png" />
    <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-23535460-1']);
    _gaq.push(['_trackPageview']);
    (function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>
    </head>
    <body>
    <div id="pinstripe">
    </div>
    <div id="mainContent">
    <header>
    <!-- Utility Links -->
    <div class="row1">
    <form action="/search" method="get">
    <label for="search">Search Terms</label>
    <input placeholder="Search:" id="search" name="search" type="text" />
    <input type="image" src="/images/search.png" alt="search" />
    </form>
    <!-- Place this tag where you want the +1 button to render -->
    <div id="plusone">
    <div class="g-plusone" data-size="small" data-annotation="none"></div>
    </div>
    <!-- Place this render call where appropriate -->
    <script type="text/javascript">
    (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    </script>
    <!--Social Media Macro Here-->
    </div>
    <div class="row3">
    <h1>
    <a href="/">
    <img src="/images/dcmsLogo.png" alt="DCMS by DSoft Technology" />
    </a>
    </h1>
    <nav>
    <!--Navigation Macro Here-->
    </nav>
    </div>
    </header>
    <section id="content">
    </section>
    <footer>
    <span style="float: left; text-align: left; display: inline; margin-left: 5px;"><a href="http://www.dsoft-cms.com/site-map">Site Map</a></span>
    </footer>
    </div>
    <script src="/scripts/jquery.placeholder-label.js" type="text/javascript"></script>
    <script src="/scripts/common.js" type="text/javascript"></script>
    </body>
    </html>

    This fails with the the oh-so-horrible "Sorry, an error occurred while processing your request." message.

  • Drew DeVault 22 posts 43 karma points
    Mar 16, 2012 @ 22:50
    Drew DeVault
    0

    Ah, it appears that my issue was @DynamicModel.metaKeywords, which should have been @Umbraco.Field, and not in the _Layout template.

Please Sign in or register to post replies

Write your reply to:

Draft