Error executing template "Designs/exhibition_site/_parsed/espresso.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_7d13b7ddedff45a39ad0a2bf2becdd94.Execute() in E:\Websites\mch365.espresso5.dk\Files\Templates\Designs\exhibition_site\_parsed\espresso.parsed.cshtml:line 18
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.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using System.IO 3 @using System.Web 4 @using System.Globalization 5 @using Co3.Espresso.Website.Services 6 @using Dynamicweb.Frontend 7 @using Dynamicweb.Ecommerce.Common 8 @using Dynamicweb.Security.UserManagement 9 @{ 10 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 11 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; 12 int globalAreaId = PageView.Current().Area.ID; 13 CultureInfo currencyCulture = new CultureInfo(Context.Currency.CultureInfo); 14 string currencySeparatorDecimal = currencyCulture.NumberFormat.NumberDecimalSeparator; 15 string currencySeparatorInteger = currencyCulture.NumberFormat.NumberGroupSeparator; 16 string openGraphUrl = PageView.Current().SearchFriendlyUrl; 17 18 bool loadGoogleTagManager = !string.IsNullOrEmpty(Espresso.Area.GoogleTagManagerID) && 19 !(Espresso.Area.Item.GoogleTagManagerDisableIfPerformanceTestIsDetected == "True" && HttpContext.Current.Request.UserAgent.ToLower().Contains("lighthouse")); 20 string hasCookiebot = PageView.Current().Area.Item["Cookiebot"]?.ToString(); 21 22 bool isProduct = !string.IsNullOrEmpty(HttpContext.Current.Request["productId"]); 23 24 string profileProductCompanyName = RenderSnippet("profileProductCompanyName").ToString(); 25 string profileProductCompanyDescription = RenderSnippet("profileProductCompanyDescription").ToString(); 26 string profileProductCompanyLogo = RenderSnippet("profileProductCompanyLogo").ToString(); 27 28 string openGraphTitle = isProduct ? profileProductCompanyName : Espresso.OpenGraphTitle; 29 string openGraphDescription = isProduct ? profileProductCompanyDescription : Espresso.OpenGraphDescription; 30 string metaDescription = isProduct ? profileProductCompanyDescription : Espresso.DynamicwebPage.Description; 31 32 string openGraphImage = isProduct ? HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + profileProductCompanyLogo : HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + Espresso.OpenGraphImage; 33 34 bool isLoppeOgStumpemarkedDA = globalAreaId == 46; 35 bool isHestOgRytterDA = globalAreaId == 37; 36 bool isFerieForAlleDA = globalAreaId == 36; 37 bool isFormlandDA = globalAreaId == 28; 38 bool isFoodtechDA = globalAreaId == 24; 39 bool isGameboxDA = globalAreaId == 43; 40 bool isAgromekDA = globalAreaId == 25; 41 bool isFoodexpoDA = globalAreaId == 38; 42 bool isElbilmessenDA = globalAreaId == 56; 43 bool isAutomatikmesseDA = globalAreaId == 42; 44 45 46 } 47 <!DOCTYPE html> 48 <html lang="@globalAreaLang" data-separator-integer="@currencySeparatorInteger" data-separator-decimal="@currencySeparatorDecimal"> 49 <head> 50 51 @GetValue("CopyRightNotice") 52 <meta charset="utf-8"> 53 <meta content="width=device-width, initial-scale=1, shrink-to-fit=no, minimal-ui" name="viewport"> 54 <meta content="ie=edge" http-equiv="x-ua-compatible"> 55 <link href="https://cdnjs.cloudflare.com" rel="preconnect"> 56 <link href="https://www.googletagmanager.com" rel="preconnect"> 57 <link href="https://www.google-analytics.com" rel="preconnect"> 58 <link href="https://connect.facebook.net" rel="preconnect"> 59 <title>@GetValue("Title")</title> 60 @Espresso.CriticalCSS 61 @RenderingService.Instance.PartialView("_partials/webfonts.cshtml", Espresso) 62 <link href="/Files/Templates/Designs/exhibition_site/_assets/_dist/css/default.css?v=2.8.6" media="@Espresso.StylesheetAttributeMedia" rel="@Espresso.StylesheetAttributeRel" as="style"> 63 @Espresso.CriticalJS 64 <link rel="shortcut icon" href="@Espresso.Area.Item.Favicon"> 65 <meta name="description" content="@metaDescription"> 66 @GetValue("MetaTags") 67 @if (Espresso.IsStagingUrl) 68 { 69 <meta content="noindex,nofollow" name="robots"> 70 } 71 <meta property="og:url" content="@openGraphUrl"> 72 <meta property="og:title" content="@openGraphTitle"> 73 <meta property="og:description" content="@openGraphDescription"> 74 <meta property="og:image" content="@openGraphImage"> 75 <meta property="og:type" content="website"> 76 @if (isFerieForAlleDA) 77 { 78 <meta name="p:domain_verify" content="cd4725e805acd772d7cf78e56bc9d58b"> 79 } 80 @if (string.IsNullOrEmpty(Espresso.Area.Item.GoogleSiteVerification) == false) 81 { 82 <meta name="google-site-verification" content="@Espresso.Area.Item.GoogleSiteVerification"> 83 } 84 85 @if (loadGoogleTagManager) 86 { 87 <!-- Google Tag Manager --> 88 <script data-cookieconsent="ignore"> 89 (function (w, d, s, l, i) { 90 w[l] = w[l] || []; 91 w[l].push({ 92 'gtm.start': 93 new Date().getTime(), 94 event: 'gtm.js' 95 }); 96 var f = d.getElementsByTagName(s)[0], 97 j = d.createElement(s), 98 dl = l != 'dataLayer' ? '&l=' + l : ''; 99 j.async = true; 100 j.src = 101 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 102 f.parentNode.insertBefore(j, f); 103 })(window, document, 'script', 'dataLayer', '@Espresso.Area.GoogleTagManagerID'); 104 </script> 105 <!-- End Google Tag Manager --> 106 } 107108 <script data-cookieconsent="ignore" src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script> 109 <script data-cookieconsent="ignore" src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js"></script> 110111 @if (isFormlandDA) 112 { 113 // Chatbot 114 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="69d4df4f659e985b0ffba609" async="" domain="www.formland.dk"></script> 115 } 116 @if (isFerieForAlleDA) 117 { 118 // Chatbot 119 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="69899f7cda2a82fa85814adc" async="" domain="www.ferieforalle.dk"></script> 120 } 121 @if (isHestOgRytterDA) 122 { 123 // Chatbot 124 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="69899f70da2a82fa85814ac9" async="" domain="www.hestogrytter.dk"></script> 125 } 126 @if (isLoppeOgStumpemarkedDA) 127 { 128 // Chatbot 129 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992eef5172e28e2162f5d75" async="" domain="www.loppeogstumpemarked.dk"></script> 130 } 131 @if (isFoodtechDA) 132 { 133 // Chatbot 134 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992ef1c172e28e2162f5d93" async="" domain="www.foodtech.dk"></script> 135 } 136 @if (isGameboxDA) 137 { 138 // Chatbot 139 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992ef25172e28e2162f5d9d" async="" domain="www.gameboxfestival.dk"></script> 140 } 141 @if (isAgromekDA) 142 { 143 // Chatbot 144 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992ef31172e28e2162f5da6" async="" domain="www.agromek.dk"></script> 145 } 146 @if (isElbilmessenDA) 147 { 148 // Chatbot 149 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992ef52172e28e2162f5dc5" async="" domain="www.elbilmessen.dk"></script> 150 } 151 @if (isFoodexpoDA) 152 { 153 // Chatbot 154 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="6992ef3b172e28e2162f5db2" async="" domain="www.foodexpo.dk"></script> 155 } 156 @if (isAutomatikmesseDA) 157 { 158 // Chatbot 159 <script src="https://files.userlink.ai/public/embed.min.js" charset="utf-8" id="bai-scr-emb" data-cid="69d4dfa2659e985b0ffba64f" async="" domain="www.automatikmesse.dk"></script> 160 } 161162 @if (isFoodexpoDA) 163 { 164 <!-- Adform Tracking Code BEGIN --> 165 <script type="text/javascript"> 166 window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []); 167 window._adftrack.push({ 168 HttpHost: 'track.adform.net', 169 pm: 4033194 170 }); 171 (function () { 172 var s = document.createElement('script'); 173 s.type = 'text/javascript'; 174 s.async = true; 175 s.src = 'https://s2.adform.net/banners/scripts/st/trackpoint-async.js'; 176 var x = document.getElementsByTagName('script')[0]; 177 x.parentNode.insertBefore(s, x); 178 })(); 179 </script> 180 <!-- Adform Tracking Code END --> 181 } 182 <script type="text/javascript"> 183 let widgets = []; 184185 function onLoadRecaptcha() { 186 document.querySelectorAll('.g-recaptcha').forEach(function (el, index) { 187 let form = el.closest('form'); 188 let widgetId = grecaptcha.render(el, { 189 'sitekey': el.dataset.sitekey, 190 'callback': function () { 191 onCaptchaCompleted(widgetId); 192 } 193 }); 194195 widgets.push({ 196 widgetId: widgetId, 197 form: form 198 }); 199 }); 200 } 201202 function onCaptchaCompleted(widgetId) { 203 const widget = widgets.find(w => w.widgetId === widgetId); 204 if (widget && widget.form) { 205 let form = widget.form; 206 const hiddenField = form.querySelector('input[name="reCAPTCHA"]'); 207 hiddenField.value = 1; 208 hiddenField.dispatchEvent(new Event('input')); 209 hiddenField.checkValidity(); 210 form.querySelector('.g-recaptcha').classList.remove('has-error'); 211 } 212 } 213 </script> 214 <script src="https://www.google.com/recaptcha/api.js?onload=onLoadRecaptcha&render=explicit" async="" defer=""></script> 215216 </head> 217218 <body class="@Espresso.Item.CustomClasses" data-is-user-authenticated="@isUserAuthenticated.ToString().ToLower()" data-design="@Espresso.Area.DesignsFolderName"> 219 @if (loadGoogleTagManager) 220 { 221 <!-- Google Tag Manager (noscript) --> 222 <noscript> 223 <iframe src="https://www.googletagmanager.com/ns.html?id=@Espresso.Area.GoogleTagManagerID" height="0" width="0" style="display: none; visibility: hidden"></iframe> 224 </noscript> 225 <!-- End Google Tag Manager (noscript) --> 226 } 227 @if (isFoodexpoDA) 228 { 229 <!-- Adform Tracking Code BEGIN --> 230 <noscript> 231 <p style="margin:0;padding:0;border:0;"> 232 <img src="https://track.adform.net/Serving/TrackPoint/?pm=4033194" width="1" height="1" alt=""> 233 </p> 234 </noscript> 235 <!-- Adform Tracking Code END --> 236 } 237 <noscript> 238 <p style="margin:0;padding:0;border:0;"> 239 <img src="https://track.adform.net/Serving/TrackPoint/?pm=4033194" width="1" height="1" alt=""> 240 </p> 241 </noscript> 242243 @using System.Text.RegularExpressions 244 @using Co3.Espresso.Website.Models.FrontEnd 245 @using Co3.Espresso.Website.Models.FrontEnd.Settings 246 @using Co3.Espresso.Website.Services 247 @using Co3.MCH.Website.Frontend.Helpers 248 @using Co3.MCH.Website.Frontend.Models.Frontend 249 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 250 @{ 251 Espresso.Canvas.Classes.AddClasses( "js-e-canvas is-loading" ); 252 if ( Espresso.Item.CanvasFullscreen == "True" ) 253 { 254 Espresso.Canvas.Classes.AddClasses( "is-fullscreen" ); 255 } 256257 if ( Espresso.Item.HeaderTransparent == "True" ) 258 { 259 Espresso.Canvas.Classes.AddClasses( "header-is-transparent" ); 260 } 261262 } 263264265266 @{ 267268 Regex hexcodeRegex = new Regex(@"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"); 269 string exhibitionColorPrimary = hexcodeRegex.IsMatch( MCH365Context.Current.TradeShowDetails.PrimaryColor ) ? MCH365Context.Current.TradeShowDetails.PrimaryColor : "#000000"; 270 string exhibitionColorSecondary = hexcodeRegex.IsMatch( MCH365Context.Current.TradeShowDetails.SecondaryColor ) ? MCH365Context.Current.TradeShowDetails.SecondaryColor : "#000000"; 271 string exhibitionColorTertiary = hexcodeRegex.IsMatch( MCH365Context.Current.TradeShowDetails.TertiaryColor ) ? MCH365Context.Current.TradeShowDetails.TertiaryColor : "#000000"; 272273 ColorHelper.HSL brandPrimary = ColorHelper.Instance.HexToHsl(exhibitionColorPrimary); 274 ColorHelper.HSL brandSecondary = ColorHelper.Instance.HexToHsl(exhibitionColorSecondary); 275 ColorHelper.HSL brandTertiary = ColorHelper.Instance.HexToHsl(exhibitionColorTertiary); 276277 } 278279 <style> 280 :root { 281 --primary-color: @brandPrimary.ToString(); 282 --primary-color-darken: @brandPrimary.Darken(10).ToString(); 283284 --secondary-color: @brandSecondary.ToString(); 285 --secondary-color-darken: @brandSecondary.Darken(10).ToString(); 286287 --tertiary-color: @brandTertiary.ToString(); 288 --tertiary-color-darken: @brandTertiary.Darken(10).ToString(); 289290 --exhibition-profile-primary-brand-color: hsl(var(--primary-color)); 291 --exhibition-profile-secondary-brand-color: hsl(var(--secondary-color)); 292 --exhibition-profile-tertiary-brand-color: hsl(var(--tertiary-color)); 293294 --exhibition-profile-primary-brand-color-darken: hsl(var(--primary-color-darken)); 295 --exhibition-profile-secondary-brand-color-darken: hsl(var(--secondary-color-darken)); 296 --exhibition-profile-tertiary-brand-color-darken: hsl(var(--tertiary-color-darken)); 297 } 298 </style> 299300301302 <div class="e-loading-overlay e-page-loading-overlay is-loading js-e-page-loading-overlay"> 303 @RenderingService.Instance.PartialView( "_partials/loading-spinner.cshtml" ) 304 </div> 305306 <div class="@Espresso.Canvas.Classes"> 307308 @*<a href="#dwcontentmain" class="custom-skiptocontent">@Translate("Gå til sidens indhold")</a>*@ 309310 @RenderingService.Instance.PartialView("_partials/header.cshtml", Espresso) 311 @RenderingService.Instance.PartialView("usermanagement/viewprofile/espresso-impersonate-user-msg.cshtml", Espresso) 312 <main id="dwcontentmain" tabindex="-1" role="main" class="e-content js-e-content @Espresso.ContentArea.Classes"> 313314 <article class="e-content-article"> 315 @RenderingService.Instance.PartialView("_partials/nav-local-vertical.cshtml", Espresso) 316 @RenderingService.Instance.SectionStart(new SectionSettings()) 317 @GetValue("DwContent(dwcontentmain)") 318 @RenderingService.Instance.SectionEnd() 319 </article> 320 </main> 321322 @RenderingService.Instance.PartialView("_partials/footer.cshtml", Espresso) 323324 @if (!string.IsNullOrEmpty(GetString("DwContent(dwcontentcta)"))) 325 { 326 <aside class="e-cta fixed-top is-hidden js-e-cta" id="dwcontentcta"> 327 @RenderingService.Instance.SectionStart(new SectionSettings 328 { 329 ContentClasses = new ClassList("col-12"), 330 OuterRowClasses = new ClassList("row no-gutters"), 331 InnerRowClasses = new ClassList("row no-gutters justify-content-center align-items-center") 332 }) 333 @GetValue("DwContent(dwcontentcta)") 334 @RenderingService.Instance.SectionEnd() 335336 </aside> 337 } 338339 @RenderingService.Instance.PartialView("ecom7/cartv2/step/espresso-cart-msg.cshtml") 340 </div> 341342 @RenderingService.Instance.PartialView( "_partials/search.cshtml", Espresso ) 343344 @RenderingService.Instance.PartialView( "_partials/back-to-top.cshtml", Espresso ) 345346 @if ( 1 == 2 ) 347 { 348 @GetValue("DwCookieWarning") 349 } 350351352 <script data-cookieconsent="ignore" async="" src="/Files/Templates/Designs/exhibition_site/_assets/_dist/js/default.js?v=1.10.4"></script> 353354355 </body> 356357 @GetValue("CopyRightNotice") 358 </html>