Error executing template "Designs/Dadeskampagne/_parsed/Default.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_3e20d7868e934609836ec89e87008e3a.Execute() in E:\Dynamicweb.net\Solutions\production.datea\Files\Templates\Designs\Dadeskampagne\_parsed\Default.parsed.cshtml:line 10
   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 @using Dynamicweb.Rendering; 2 @using System.IO; 3 @using System.Web; 4 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 5 @{ 6 string cookieBotID = ""; 7 var faviconPath = "/favicon" + Pageview.AreaID + ".ico"; 8 var showPopup = false; 9 cookieBotID = Pageview.Area.Item["CookieBotID"] == null ? string.Empty : Pageview.Area.Item["CookieBotID"].ToString(); 10 string themeName = Pageview.Area.Item["KampagneTema"].ToString(); 11 12 if (GetBoolean("Item.Area.PopupActive")) 13 { 14 var popupCookie = HttpContext.Current.Request.Cookies["popup"]; 15 16 if (popupCookie == null) // show popup for the first time - cookie has newer been set 17 { 18 showPopup = true; 19 } 20 else 21 { 22 var createdDate = popupCookie.Values.Get("CreatedDate") != null ? Convert.ToDateTime(popupCookie.Values.Get("CreatedDate")) : DateTime.MinValue; 23 24 if (DateTime.Now > createdDate.AddHours(24)) 25 { 26 showPopup = true; 27 } 28 } 29 } 30 } 31 <!DOCTYPE html> 32 <!--[if IE 7]><html lang="da" class="no-js lt-ie9 lt-ie8"><![endif]--> 33 <!--[if IE 8]><html lang="da" class="no-js lt-ie9"><![endif]--> 34 <!--[if gte IE 9]><!--> 35 <html lang="da" class="no-js"> 36 <!--<![endif]--> 37 <head> 38 39 <!-- Google Tag Manager --> 40 <script data-cookieconsent="ignore"> 41 (function (w, d, s, l, i) { 42 w[l] = w[l] || []; 43 w[l].push({ 44 'gtm.start': 45 new Date().getTime(), 46 event: 'gtm.js' 47 }); 48 var f = d.getElementsByTagName(s)[0], 49 j = d.createElement(s), 50 dl = l != 'dataLayer' ? '&l=' + l : ''; 51 j.async = true; 52 j.src = 53 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 54 f.parentNode.insertBefore(j, f); 55 })(window, document, 'script', 'dataLayer', '@GetString("Item.Area.GTM_ID")'); 56 </script> 57 <!-- End Google Tag Manager --> 58 59 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="@cookieBotID" type="text/javascript" data-blockingmode="auto" async=""></script> 60 61 <meta charset="utf-8"> 62 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 63 <title>@GetValue("Title")</title> 64 @GetValue("MetaTags") 65 @GetValue("CopyRightNotice") 66 67 68 @RenderSnippet("MetatagSnippet") 69 <meta name="viewport" content="width=device-width, initial-scale=1"> 70 <meta name="format-detection" content="telephone=no"> 71 <link href="//fonts.googleapis.com/css?family=Work+Sans:100,300,400,500,600,800,900" rel="stylesheet" type="text/css"> 72 <link rel="stylesheet" href="/Files/Templates/Designs/frontendThemes/static/dist/css/campaign.min.css"> 73 @if (File.Exists(HttpContext.Current.Server.MapPath(faviconPath))) 74 { 75 <link rel="shortcut icon" href="@faviconPath"> 76 } 77 @GetValue("Stylesheets") 78 @GetValue("Javascripts") 79 </head> 80 <body class="campaign theme--@themeName {{fixed}}" ng-controller="MainCtrl as mainctrl" login-overlay="" search-overlay=""> 81 <!-- Google Tag Manager (noscript) --> 82 <noscript> 83 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5JFR3BF" height="0" width="0" style="display: none; visibility: hidden"></iframe> 84 </noscript> 85 <!-- End Google Tag Manager (noscript) --> 86 87 @using Dynamicweb.Rendering; 88 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 89 90 <header class="header "> 91 <div class="container"> 92 @{ 93 var logo = GetString("Item.Area.Logo.Value"); 94 95 if (logo != "") 96 { 97 <img src="@logo" class="logo logo--centered"> 98 } 99 100 var hideMenu = Pageview.Area.Item["HideMenu"] == null ? false : Convert.ToBoolean(Pageview.Area.Item["HideMenu"]); 101 102 if (!hideMenu) 103 { 104 <div class="menu-toggle" ng-click="mainctrl.openMenu()"> 105 <button class="btn-mobile-menu"></button> 106 </div> 107 } 108 } 109 <nav class="navigation" ng-class="{'open':mainctrl.open}"> 110 @GetValue("DwNavigation(NavigationTop)") 111 </nav> 112 </div> 113 </header> 114 115 116 @using Dynamicweb.Rendering; 117 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 118 119 @GetValue("Layout.Title(Default)") 120 @GetValue("Layout.Description(Default)") 121 122 <div id="content1">@GetValue("DwContent(content1)")</div> 123 124 @using Dynamicweb.Rendering; 125 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 126 127 <footer class="footer"> 128 <div class="container"> 129 <div class="footer-wrapper"> 130 <div class="footer__info"> 131 <a href="http://www.datea.dk" target="_blank"> 132 <div class="footer__logo"> 133 <h3>Udlejning</h3> 134 <img src="/Files/Templates/Designs/frontendThemes/static/dist/img/newsec_logo.svg" alt="" width="69" height="96"> 135 </div> 136 </a> 137 <dl> 138 <dt>Adresse:</dt> 139 <dd class="address"> 140 <svg class="icon" role="img"> 141 <use xlink:href="/Files/Templates/Designs/frontendThemes/static/dist/icons.svg#icon__footer--address"></use> 142 </svg> 143 Lyngby Hovedgade 4, 2800 Kgs. Lyngby 144 </dd> 145 <dt>Telefon:</dt> 146 <dd class="phone"> 147 <svg class="icon" role="img"> 148 <use xlink:href="/Files/Templates/Designs/frontendThemes/static/dist/icons.svg#icon__footer--phone"></use> 149 </svg> 150 <a href="tel:45260102">45 26 01 02</a> 151 </dd> 152 <dt>Email:</dt> 153 <dd class="mail"> 154 <svg class="icon" role="img"> 155 <use xlink:href="/Files/Templates/Designs/frontendThemes/static/dist/icons.svg#icon__footer--mail"></use> 156 </svg> 157 <a href="mailto:boligudlejning@newsec.dk">boligudlejning@newsec.dk</a> 158 </dd> 159 <dt>CVR:</dt> 160 <dd class="cvr"> 161 <span class="cvr__title">CVR: </span> 162 <svg class="icon" role="img"> 163 <use xlink:href="/Files/Templates/Designs/frontendThemes/static/dist/icons.svg#icon__footer__cvr"></use> 164 </svg> 165 25326296 166 </dd> 167 <dt></dt> 168 <dd> 169 <ul class="links"> 170 @foreach (LoopItem linkSection in GetLoop("Item.Area.LinkSektion")) 171 { 172 var link = linkSection.GetValue("Item.Area.LinkSektion.Link"); 173 var linkTarget = linkSection.GetString("Item.Area.LinkSektion.LinkTarget") == "" ? "_self" : linkSection.GetValue("Item.Area.LinkSektion.LinkTarget"); 174 175 <li><a href="@link" target="@linkTarget" style="text-decoration: none;color:#fff">@linkSection.GetValue("Item.Area.LinkSektion.Navn")</a></li> 176 } 177 </ul> 178 </dd> 179 </dl> 180 </div> 181 182 <div class="footer__right-col"> 183 <div> 184 <h3>Ejer</h3> 185 <img src="/Files/Templates/Designs/frontendThemes/static/dist/img/dades-logo.png" alt="" width="69" height="96"> 186 </div> 187 </div> 188 </div> 189 </div> 190 </footer> 191 192 <button class="to-top" to-top="">Til top</button> 193 194 <div class="search-overlay" data-id="1058" data-no-results="Intet Resultat" data-placeholder="Skriv søgeord"> 195 <div class="overlay"></div> 196 197 <div class="search"> 198 <div class="field"> 199 <input id="searchInput" autocomplete="false"> 200 <label for="searchInput" class="searchLabel">Skriv søgeord</label> 201 <button> 202 <svg class="icon" role="img"> 203 <use xlink:href="/Files/Templates/Designs/frontendThemes/static/dist/icons.svg#icon__search--gray"></use> 204 </svg> 205 Søg 206 </button> 207 </div> 208 <ul class="results"></ul> 209 <div class="showmore">Show more </div> 210 </div> 211 212 <div class="closeSearch">Close</div> 213 </div> 214 215 216 217 218 @if (showPopup) 219 { 220 HttpContext.Current.Response.Cookies["popup"].Values.Set("CreatedDate", DateTime.Now.ToString()); 221 HttpContext.Current.Response.Cookies["popup"].Expires = DateTime.Now.AddHours(24); 222 var popupParagraphList = GetLoop("Item.Area.PopupList"); 223 224 <div id="property-overlay" class="overlay__wrapper"> 225 <div class="overlay__content"> 226 <button class="overlay__close-icon" data-remove="#property-overlay">Close</button> 227 <h2 class="overlay__heading">@GetString("Item.Area.PopupHeading")</h2> 228 <div class="overlay__row"> 229 @foreach (var paragraph in popupParagraphList) 230 { 231 if (paragraph.GetBoolean("Item.Area.PopupList.Show")) 232 { 233 <div> 234 @paragraph.GetString("Item.Area.PopupList.Text") 235 </div> 236 } 237 } 238 </div> 239 </div> 240 </div> 241 } 242 243 <script async="" defer="" src="/Files/Templates/Designs/frontendThemes/static/dist/js/main.min.js"></script> 244 </body> 245 </html>