Error executing template "Designs/SeedsNZ/_parsed/Dw_Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_d4a52df9773442aab689a0f16a05e01f.Execute() in D:\home\site\wwwroot\Application\Files\Templates\Designs\SeedsNZ\_parsed\Dw_Page.parsed.cshtml:line 62
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits ViewModelTemplate<PageViewModel> 2 @using Dynamicweb.Content 3 @using PgwSeeds.SeedsNZ 4 @using System.Net 5 @using System.Web.Mvc 6 @using System.Web.Mvc.Html 7 @using Dynamicweb.Frontend; 8 @using Dynamicweb.Rendering; 9 @using System.Configuration 10 @using Microsoft.ApplicationInsights.Web; 11 @using System.Web; 12 @using System.Web.Optimization 13 14 <!DOCTYPE html> 15 <html> 16 <head> 17 <script type="text/javascript"> 18 var sdkInstance = "appInsightsSDK"; window[sdkInstance] = "appInsights"; var aiName = window[sdkInstance], aisdk = window[aiName] || function (e) { function n(e) { t[e] = function () { var n = arguments; t.queue.push(function () { t[e].apply(t, n) }) } } var t = { config: e }; t.initialize = !0; var i = document, a = window; setTimeout(function () { var n = i.createElement("script"); n.src = e.url || "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js", i.getElementsByTagName("script")[0].parentNode.appendChild(n) }); try { t.cookie = i.cookie } catch (e) { } t.queue = [], t.version = 2; for (var r = ["Event", "PageView", "Exception", "Trace", "DependencyData", "Metric", "PageViewPerformance"]; r.length;)n("track" + r.pop()); n("startTrackPage"), n("stopTrackPage"); var s = "Track" + r[0]; if (n("start" + s), n("stop" + s), n("setAuthenticatedUserContext"), n("clearAuthenticatedUserContext"), n("flush"), !(!0 === e.disableExceptionTracking || e.extensionConfig && e.extensionConfig.ApplicationInsightsAnalytics && !0 === e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)) { n("_" + (r = "onerror")); var o = a[r]; a[r] = function (e, n, i, a, s) { var c = o && o(e, n, i, a, s); return !0 !== c && t["_" + r]({ message: e, url: n, lineNumber: i, columnNumber: a, error: s }), c }, e.autoExceptionInstrumented = !0 } return t }( 19 { 20 instrumentationKey: '@ConfigurationManager.AppSettings["aiinstrumentationKey"]', 21 disableCorrelationHeaders: false 22 } 23 ); 24 window.appInsights = aisdk; 25 window.appInsights.queue.push(function () { 26 var serverId = "@HttpContext.Current.GetRequestTelemetry().Context.Operation.Id"; 27 appInsights.properties.context.telemetryTrace.traceID = serverId; 28 29 }); 30 aisdk.trackPageView(); 31 </script> 32 <meta charset="utf-8" /> 33 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 34 @Model.MetaTags 35 <title>@Model.Title | PGG Wrightson Seeds</title> 36 37 <link rel="apple-touch-icon" sizes="57x57" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-57x57.png" /> 38 <link rel="apple-touch-icon" sizes="60x60" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-60x60.png" /> 39 <link rel="apple-touch-icon" sizes="72x72" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-72x72.png" /> 40 <link rel="apple-touch-icon" sizes="76x76" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-76x76.png" /> 41 <link rel="apple-touch-icon" sizes="114x114" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-114x114.png" /> 42 <link rel="apple-touch-icon" sizes="120x120" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/apple-touch-icon-120x120.png" /> 43 <link rel="icon" type="image/png" sizes="32x32" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-32x32.png" /> 44 <link rel="icon" type="image/png" sizes="96x96" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-96x96.png" /> 45 <link rel="icon" type="image/png" sizes="16x16" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon-16x16.png" /> 46 <link rel="icon" href="/Files/Templates/Designs/SeedsNZ/assets/favicon/favicon.ico" /> 47 <script async="" src="//www.googletagmanager.com/gtm.js?id=GTM-K9NT64"></script> 48 <!-- FontAwesome --> 49 <script src="https://use.fontawesome.com/6326434619.js"></script> 50 51 <!-- TypeKit --> 52 <script src="https://use.typekit.net/oel8lyn.js"></script> 53 <script>try { Typekit.load({ async: false }); } catch (e) { }</script> 54 55 @Styles.Render("~/Content/custom/seedsnz") 56 57 @RenderSnippet("StyleSheet") 58 @RenderSnippet("JavaScript") 59 </head> 60 <body> 61 62 @this.Model.Item.GetString("AI.Operation.Id") 63 64 <!-- Google Tag Manager --> 65 <noscript> 66 <iframe src="//www.googletagmanager.com/ns.html?id=GTM-MFGDFZ" 67 height="0" width="0" style="display:none;visibility:hidden"></iframe> 68 </noscript> 69 <script> 70 (function (w, d, s, l, i) { 71 w[l] = w[l] || []; w[l].push({ 72 'gtm.start': 73 new Date().getTime(), event: 'gtm.js' 74 }); var f = d.getElementsByTagName(s)[0], 75 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 76 '//www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 77 })(window, document, 'script', 'dataLayer', 'GTM-MFGDFZ');</script> 78 79 <div class="layout__main wrap"> 80 @{ 81 var searchPage = GetPageIdByNavigationTag("Search"); 82 } 83 84 85 <header class="container-fluid"> 86 <div class="max-width-wrap col-no-padding-desktop"> 87 <div> 88 <nav class="navbar" role="navigation"> 89 <div class="navbar-header"> 90 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 91 <span class="icon-bar"></span> 92 <span class="icon-bar"></span> 93 <span class="icon-bar"></span> 94 </button> 95 <a href="Default.aspx?Id=@GetPageIdByNavigationTag(NavigationTags.Home)" id="logo" title="Back to homepage"> 96 <img class="img-responsive" src="/Files/Templates/Designs/SeedsNZ/assets/img/logo.png" alt="PGG Wrightson Seeds Logo"> 97 </a> 98 </div> 99 100 <div class="navbar-collapse collapse pull-right-md"> 101 <ul class="nav navbar-nav pull-right-md" id="navbar"> 102 @RenderNavigation(new 103 { 104 Id = "navbar", 105 Template = "navbar.xslt", 106 ExpandMode = "All", 107 EndLevel = 3 108 }) 109 </ul> 110 111 <div class="search-btn-wrap visible-xs visible-sm"> 112 <a data-target="#search-wrapper" 113 data-toggle="collapse" 114 aria-expanded="false" 115 aria-controls="search-wrapper" 116 role="button"> 117 <span class="fa fa-search hidden-xs hidden-sm"></span> 118 <span class="search-text hidden-md hidden-lg">Search</span> 119 </a> 120 </div> 121 </div> 122 </nav> 123 </div> 124 </div> 125 <div class="row collapse" id="search-wrapper"> 126 <div class="max-width-wrap"> 127 <div class="form-search-wrap"> 128 <form method="get" action="Default.aspx" name="" novalidate="novalidate"> 129 <input type="hidden" name="ID" value="@searchPage" /> 130 <input type="search" placeholder="Enter Keyword to Search" name="q"> 131 <submit class="animate-right" role="button"> 132 <span class="rounded-icon icon fa fa-angle-right"></span> 133 </submit> 134 </form> 135 </div> 136 </div> 137 </div> 138 </header> 139 140 @inherits Dynamicweb.Rendering.ViewModelTemplate<PageViewModel> 141 142 @using Dynamicweb.Frontend; 143 144 @Title("Default page template") 145 146 147 @helper DisplayContent() 148 { 149 150 <div class="container"> 151 @RenderNavigation(new 152 { 153 id = "breadcrumbs", 154 template = @".\breadcrumb.xslt", 155 expandmode = "Pathonly" 156 }) 157 158 <div class="dwcontent" id="content" title="Content"></div> 159 </div> 160 } 161 162 @DisplayContent() 163 164 <!-- SOCIAL SHARING --> 165 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 166 @using System.Web 167 <div class="share-wrap text-center"> 168 <h4>Share this page</h4> 169 @{ 170 var request = HttpContext.Current.Request; 171 var subPath = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(request.Url.PathAndQuery.TrimStart('/')); 172 var friendlyUrl = $"{request.Url.Scheme}://{request.Url.Authority}{subPath}"; 173 var url = WebUtility.UrlEncode(friendlyUrl); 174 } 175 <ul class="list-inline"> 176 <li> 177 <a class="fa fa-facebook text-center" href="https://www.facebook.com/sharer/sharer.php?u=@url" title="Share page via facebook" target="_blank"></a> 178 </li> 179 <li> 180 <a class="fa fa-twitter text-center" href="https://twitter.com/home?status=@url" title="Share page via twitter" target="_blank"></a> 181 </li> 182 <li> 183 <a class="fa fa-linkedin text-center" href="https://www.linkedin.com/shareArticle?mini=true&amp;url=@url" title="Share page via linkedin" target="_blank"></a> 184 </li> 185 </ul> 186 </div> 187 188 <!-- Footer --> 189 <footer class="container-fluid contact-sticky-tile"> 190 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 191 @using PgwSeeds.SeedsNZ 192 <div class="max-width-wrap"> 193 <!-- duplication for mobile --> 194 <div class="clearfix"> 195 <div class="clearfix"> 196 <div class="mobile-compact-contact-wrap hidden-md hidden-lg col-xs-12 col-sm-6"> 197 <a class="collapsed" data-target="#contact-footer-tile" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="contact-footer-tile"> 198 <h4> 199 <span class="greeting">HI!</span> NEED TO GET IN TOUCH? 200 </h4> 201 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120" 202 class="img-responsive img-circle" alt="General Contact" maxwidth="120"> 203 </a> 204 </div> 205 </div> 206 207 <div class="clearfix"> 208 <div class="col-sm-5 pull-right hidden-sm hidden-xs contact-footer-desktop"> 209 <div class="contact-tile-outer-wrap"> 210 <div class="contact-us-greeting"> 211 <div class="contact-us-greeting-inner"> 212 <a class="collapsed" data-target="#contact-footer-tile" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="contact-footer-tile"> 213 <h4> 214 <span class="greeting">HI!</span> NEED TO GET IN TOUCH? 215 </h4> 216 </a> 217 </div> 218 </div> 219 </div> 220 </div> 221 </div> 222 223 224 <div class="hidden-lg hidden-md collapseable collapse" id="contact-footer-tile"> 225 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 226 @using PgwSeeds.SeedsNZ 227 <div class="contact-tile-outer-wrap"> 228 <div class="contact-tile-wrap"> 229 <div class="row"> 230 <div class="col-xs-4 col-no-right-padding"> 231 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120" class="img-responsive img-circle" alt="General Contact" maxwidth="120"> 232 </div> 233 <div class="col-xs-8"> 234 <h4>Contact Us</h4> 235 <p> 236 Sales &amp; General Enquiries<br> Nationwide 237 </p> 238 </div> 239 </div> 240 <ul class="list-inline text-uppercase"> 241 <li> 242 <span class="glyphicon glyphicon-earphone"></span> 243 <a href="tel:@Pageview.Area.Item["NZPhoneNumber"]"> 244 @Pageview.Area.Item["NZPhoneNumber"] 245 </a> 246 </li> 247 <li> 248 <span class="glyphicon glyphicon-envelope"></span> 249 <a href="mailto:@Pageview.Area.Item["Email"];"> 250 Email Me 251 </a> 252 </li> 253 254 </ul> 255 </div> 256 <a class="animate-right" href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)"> 257 <span>Contact your local rep</span> 258 <span class="rounded-icon icon fa fa-angle-right"></span> 259 </a> 260 </div> 261 262 263 </div> 264 </div> 265 <!-- duplication for mobile --> 266 <div class="row"> 267 <div class="col-md-6 col-sm-12 link-tiles-wrap"> 268 <div class="row"> 269 270 <div class="col-md-3 col-sm-3 col-xs-6"> 271 <strong>News</strong> 272 <ul class="list-unstyled"> 273 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.CaseStudies)" target="" alt="Case Studies">Case Studies</a></li> 274 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.Social)" target="" alt="Social Updates">Social Updates</a></li> 275 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)" target="" alt="">Contact Us</a></li> 276 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.Competitions)" target="" alt="">Competitions</a></li> 277 </ul> 278 </div> 279 280 281 <div class="col-md-3 col-sm-3 col-xs-6"> 282 <strong>Tools</strong> 283 <ul class="list-unstyled"> 284 285 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.AdvancedSearch)" target="" alt="Advanced Product Search">Advanced Product Search</a></li> 286 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.GrassSelector)" target="" alt="">Select a Pasture</a></li> 287 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.BrassicaSelector)" target="" alt="Select a Brassica">Select a Brassica</a></li> 288 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.BrassicaCropCalculator)" target="" alt="Brassica Life Calculator">Brassica Life Calculator</a></li> 289 </ul> 290 </div> 291 292 <div class="clearfix hidden-sm hidden-md hidden-lg"></div> 293 294 @{ 295 var disclaimer = "/Files/Files/Public/Disclaimer-November-2019.pdf"; 296 } 297 298 <div class="col-md-3 col-sm-3 col-xs-6"> 299 <strong>About Us</strong> 300 <ul class="list-unstyled"> 301 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.Innovating)" target="" alt="Our Innovation">Innovating for You</a></li> 302 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.Sustainability)" target="" alt="">Sustainability</a></li> 303 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.History)" target="" alt="History">History</a></li> 304 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.Careers)" target="" alt="Careers">Careers</a></li> 305 <li><a href="Admin/Public/DWSDownload.aspx?File=@disclaimer" target="" alt="">Disclaimer</a></li> 306 <li><a href="Admin/Public/DWSDownload.aspx?File=@Pageview.Area.Item["TermsOfUse"]" target="" alt="">Terms of Use</a></li> 307 <li><a href="Admin/Public/DWSDownload.aspx?File=@Pageview.Area.Item["TermsOfTrade"]" target="" alt="Terms of Trade">Terms of Trade </a></li> 308 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.PrivacyPolicy)" target="" alt="">Privacy Policy</a></li> 309 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.SocialMediaPolicy)" target="" alt="">Social Media Policy</a></li> 310 </ul> 311 </div> 312 313 314 <div class="col-md-3 col-sm-3 col-xs-6"> 315 <strong>Get in Touch</strong> 316 <ul class="list-unstyled"> 317 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)" target="" alt="Our Reps">Our Reps</a></li> 318 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)" target="" alt="Enquiries">Enquiries</a></li> 319 <li><a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.WhereToBuy)" target="" alt="Where to Buy">Where to Buy</a></li> 320 </ul> 321 </div> 322 323 </div> 324 <div class="row"> 325 <div class="col-xs-6 col-md-12"> 326 <div class="member-login va-middle hidden-sm hidden-xs"> 327 328 @if (this.Model.CurrentUser.ID == 0) 329 { 330 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.LoginPage)" class="member-login btn btn-default">Retail Login</a> 331 } 332 else 333 { 334 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.MemberHome)" class="member-login btn btn-default">Retail Home</a> 335 } 336 </div> 337 <div class="footer-social-bar va-middle"> 338 <a href="https://www.facebook.com/@Pageview.Area.Item["Facebook_Page"]/" class="fa fa-facebook" target="_blank" title="PGW Seeds Facebook"></a> 339 <a href="https://twitter.com/@Pageview.Area.Item["TwitterHandle"]" class="fa fa-twitter" target="_blank" title="PGW Seeds Twiiter"></a> 340 </div> 341 </div> 342 343 <div class="member-login va-middle hidden-md hidden-lg col-xs-6"> 344 345 @if (this.Model.CurrentUser.ID == 0) 346 { 347 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.LoginPage)" class="member-login btn btn-default">Retail Login</a> 348 } 349 else 350 { 351 <a href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.MemberHome)" class="member-login btn btn-default">Retail Home</a> 352 } 353 </div> 354 </div> 355 </div> 356 <div class="col-sm-5 pull-right hidden-sm hidden-xs"> 357 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 358 @using PgwSeeds.SeedsNZ 359 <div class="contact-tile-outer-wrap"> 360 <div class="contact-tile-wrap"> 361 <div class="row"> 362 <div class="col-xs-4 col-no-right-padding"> 363 <img src="/Files/Templates/Designs/SeedsNZ/assets/img/Phone.jpg" maxheight="120" class="img-responsive img-circle" alt="General Contact" maxwidth="120"> 364 </div> 365 <div class="col-xs-8"> 366 <h4>Contact Us</h4> 367 <p> 368 Sales &amp; General Enquiries<br> Nationwide 369 </p> 370 </div> 371 </div> 372 <ul class="list-inline text-uppercase"> 373 <li> 374 <span class="glyphicon glyphicon-earphone"></span> 375 <a href="tel:@Pageview.Area.Item["NZPhoneNumber"]"> 376 @Pageview.Area.Item["NZPhoneNumber"] 377 </a> 378 </li> 379 <li> 380 <span class="glyphicon glyphicon-envelope"></span> 381 <a href="mailto:@Pageview.Area.Item["Email"];"> 382 Email Me 383 </a> 384 </li> 385 386 </ul> 387 </div> 388 <a class="animate-right" href="Default.aspx?ID=@GetPageIdByNavigationTag(NavigationTags.ContactUs)"> 389 <span>Contact your local rep</span> 390 <span class="rounded-icon icon fa fa-angle-right"></span> 391 </a> 392 </div> 393 394 395 </div> 396 </div> 397 </div> 398 </footer> 399 <div class="visible-lg-block visible-md-block visible-sm-block visible-xs-block go-to-top hidden"> 400 <div class="triangle"></div> 401 TOP 402 </div> 403 </div> 404 405 <script src="https://code.jquery.com/jquery.min.js"></script> 406 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js"></script> 407 <!-- Custom handling of unobtrusive validation css classes --> 408 <script src="Files/Templates/Designs/Common/assets/js/validation.custom.js"></script> 409 410 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script> 411 412 @Scripts.Render("~/bundles/custom/seedsnz") 413 @RenderSnippet("JavaScriptBottom") 414 <!--[if lt IE 9]> 415 <script src="/Assets/Core/js/dist/ie/html5shiv.min.js"></script> 416 <script src="/Assets/Core/js/dist/ie/respond.min.js"></script> 417 <![endif]--> 418 <!--[if lt IE 10]> 419 <script src="/Assets/Core/js/dist/ie/jquery.placeholder.min.js"></script> 420 window.onload = function() { 421 $('input, textarea').placeholder(); 422 }; 423 <![endif]--> 424 </body> 425 </html>