Error executing template "Designs/barhandel2017/_parsed/Dokumentside.parsed.cshtml"
System.ArgumentException: Object type cannot be converted to target type.
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CleanupHelper.Init(AppDomain domain, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.InitHelper.CreateHelper()
   at RazorEngine.Compilation.ExecutionContextLessThread.CallHelperSafeHelper`2.AsAction()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallFunc[O](Func`1 f)
   at RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault)
   at RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   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 System.IO; 2 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3 @{ 4 string openBlank = ((GetBoolean("Item.OpenInNewWindow"))) ? "_blank" : ""; 5 bool myList = ((GetBoolean("Item.ActivateAddToList"))) ? GetBoolean("Item.ActivateAddToList") : false; 6 string tooltipClass = (myList) ? "has-tooltip" : "no-tooltip"; 7 string link = GetString("Item.Link"); 8 9 string pageName = (!string.IsNullOrWhiteSpace(GetString("Item.Titel"))) ? GetString("Item.Titel") : GetString("Item.PageName"); 10 11 char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); 12 bool isFaktaark = (GetString("Item.Dokumenttype") == "faktaark") ? true:false; 13 bool LinkTilSide = GetBoolean("Item.LinkTilSide"); 14 string dokumentlink = GetString("Item.Link"); 15 bool AutogenererPDF = (GetBoolean("Item.Autogenerer_PDF") == true) ? true : false; 16 17 } 18 <!DOCTYPE html> 19 <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> 20 <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> 21 <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> 22 <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> 23 <head> 24 <style> 25 #CybotCookiebotDialog { border: 0px solid #000000 !important; } 26 #CybotCookiebotDialogBodyContent { padding-top: 20px !important; } 27 .CybotCookiebotDialogBodyButton { padding: 6px 4px 6px !important; } 28 #CybotCookiebotDialog a, #CybotCookiebotDialog div, #CybotCookiebotDialogBodyContentControls, #CybotCookiebotDialogBodyContentTitle { 29 font-family: 'Play',Arial,Helvetica,Verdana,sans-serif !important; 30 font-weight: 400 !important; 31 } 32 </style> 33 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="6891d378-54b5-407a-8026-0aff96893441" data-blockingmode="auto" type="text/javascript"></script> 34 <meta charset="utf-8"> 35 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 36 <title>@GetValue("Title")</title> 37 @GetValue("MetaTags") 38 @GetValue("CopyRightNotice") 39 40 41 <meta name="apple-mobile-web-app-capable" content="yes"> 42 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 43 <link href='https://fonts.googleapis.com/css?family=Play' rel='stylesheet' type='text/css'> 44 <link href='https://fonts.googleapis.com/css?family=Play:700' rel='stylesheet' type='text/css'> 45 <link href='https://fonts.googleapis.com/css?family=Economica:700' rel='stylesheet' type='text/css'> 46 <link rel="stylesheet" href="/Files/Templates/Designs/barhandel2017/css/normalize.min.css"> 47 <link rel="stylesheet" href="/Files/Templates/Designs/barhandel2017/css/main.css?v=20210121b"> 48 <link rel="stylesheet" href="/Files/Templates/Designs/barhandel2017/css/bfa2017.css?v=20220127"> 49 50 <script src="/Files/Templates/Designs/barhandel2017/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script> 51 52 <!-- Google Tag Manager --> 53 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 54 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 55 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 56 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 57 })(window,document,'script','dataLayer','GTM-T9RDCGS');</script> 58 <!-- End Google Tag Manager --> 59 60 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 61 <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.0.min.js"><\/script>')</script> 62 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script> 63 64 <!-- Oxford Research script 65 <script type="text/javascript"> 66 var wid = "BH"; 67 </script> 68 <script src="http://roiagency.dk/resources/oxford/ox.js"></script> 69 /Oxford Research script --> 70 @GetValue("Stylesheets") 71 @GetValue("Javascripts") 72 </head> 73 74 <body class="document-page"> 75 <!-- Google Tag Manager (noscript) --> 76 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T9RDCGS" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 77 <!-- End Google Tag Manager (noscript) --> 78 79 <header> 80 <div class="wrapper"> 81 <a id="logo" href="/Default.aspx?ID=15443"></a> 82 <div class="search"> 83 <form method="get" action="/Default.aspx"> 84 <input type="hidden" name="ID" value="10266"> 85 <div class="searchfield"><input class="" type="text" name="q" autocomplete="off" data-placeholder="Skriv søgeord"></div> 86 <div class="search-toggle"></div> 87 </form> 88 </div> 89 <button id="top-nav-button"> 90 <div></div> 91 <div></div> 92 <div></div> 93 </button> 94 </div> 95 </header> 96 <div class="link-logos top-logos"> 97 <div class="row"> 98 <a target="_blank" href="https://www.danskerhverv.dk/"><img alt="Dansk Erhverv" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_01.png"></a> 99 <a target="_blank" href="https://www.hk.dk/omhk/sektor/handel"><img alt="HK Handel" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_03.png"></a> 100 <a target="_blank" href="https://www.lederne.dk/"><img alt="Lederne" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_05.png"></a> 101 <a target="_blank" href="https://www.nnf.dk/"><img alt="NNF" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_07.png"></a> 102 <a target="_blank" href="https://www.drivkraftdanmark.dk/"><img alt="Drifkraft Danmark" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_09.png"></a> 103 <a target="_blank" href="https://serviceforbundet.dk/"><img alt="Service Forbundet" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_11.png"></a> 104 <a target="_blank" href="http://www.danskeslagtermestre.dk/"><img alt="Danske Slagtermestre" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_13.png"></a> 105 <a target="_blank" href="https://www.bkd.dk/"><img alt="BKD" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_15.png"></a> 106 <a target="_blank" href="https://www.ba.dk/"><img alt="BA" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_17.png"></a> 107 108 </div> 109 110 </div> 111 <nav id="top-nav" class="awesome-menu"> 112 @GetValue("DwNavigation(topnavigation)") 113 </nav> 114 <div id="content" class=""> 115 <div id="ajaxer" class="clearfix"> 116 <section class="article"> 117 <!--@If Defined(DwTopGraphic)--> 118 <div id="topgrafik"><img src="<!--@DwTopGraphicClean-->"></div> 119 <!--@EndIf(DwTopGraphic)--> 120 <!--<nav id="legend"> 121 <ul id="legendnavigation" class="dwnavigation" settings="startlevel:1;endlevel:9;expandmode:pathonly;template:navigation.xslt;"> 122 <li></li> 123 </ul> 124 </nav>--> 125 <div class="document-page-type">@GetString("Item.Dokumenttype")</div> 126 <h1 class="article-title">@GetString("Item.PageName")</h1> 127 <div class="document-list-buttons @tooltipClass"> 128 @if (isFaktaark || AutogenererPDF) 129 { 130 var validFilename = pageName; 131 foreach (char c in invalidFileNameChars) 132 { 133 validFilename = validFilename.Replace(c, '-'); 134 } 135 validFilename = validFilename + "_" + @GetString("Item.ID"); 136 string pdflink = "/Files/Filer/BARhandel/pdf_auto/" + validFilename + ".pdf"; 137 link = pdflink; 138 } 139 140 141 @if (!string.IsNullOrWhiteSpace(link) && AutogenererPDF == false) 142 { 143 <a href='@link' class="main-button" target="@openBlank">@GetString("Item.LinkTekst")</a> 144 } 145 else if (!string.IsNullOrWhiteSpace(link) && AutogenererPDF == true) 146 { 147 <a href='@link' class="main-button" target="@openBlank">Hent PDF</a> 148 } 149 150 @if (myList && !string.IsNullOrWhiteSpace(link)) 151 { 152 <button class="add-to-my-list" data-url="@link" data-name="@pageName" data-type="@GetString(" item.dokumenttype")"="">Tilføj "min liste"</button> 153 <span class="tooltip"></span> 154 } 155 156 </div> 157 <div class="divider"></div> 158 <article id="contentholder">@GetValue("DwContent(contentholder)")</article> 159 </section> 160 </div> 161 </div> 162 163 <footer> 164 <div class="inner"> 165 <div class="contact"><span class="email"><a href="mailto:info@bfahandelfinanskontor.dk">info@bfahandelfinanskontor.dk</a> </span></div> 166 <div class="share" title="Send denne side via mail til en ven.">Tip en ven</div> 167 <div class="nyhedsbrev" title="Tilmeld nyhedsbrev"><a href="https://bfahandel.us2.list-manage.com/subscribe?u=392b0cbb6bf34b47495058df3&id=f7e2b0d982" target="_blank">Tilmeld nyhedsbrev</a></div> 168 <div class="nyhedsbrev" title="Cookiepolitik"><a href="/cookiepolitik-1" target="_blank">Cookiepolitik</a></div> 169 </div> 170 <div class="inner footer-text"> 171 <p><b>Branchefællesskabet for arbejdsmiljø (BFA) Handel</b> er et samarbejde mellem 172 arbejdsgivere og arbejdstagere om at sikre et godt fysisk og psykisk arbejdsmiljø i 173 detailbranchen.</p><p> 174 BFA handel udvikler vejledninger, værktøjer og inspirationsmateriale til brug for 175 ledere, ansatte og medlemmer af arbejdsmiljøorganisationen i butikkerne. BFA 176 Handel er en del af BFA Handel, Finans og Kontor: <a href="http://bfahandelfinanskontor.dk" target="_blank">www.bfahandelfinanskontor.dk</a> 177  </p><p> 178 <b>BFA Handel, Fællessekretariatet </b> Børsen, 1217 København K, Tlf. 33 74 63 39. Mail: <a href="mailto:info@bfahandel.dk">info@bfahandel.dk</a>, www.bfahandel.dk 179 </p> 180 </div> 181 <div class="link-logos bottom-logos"> 182 <div class="row"> 183 <a target="_blank" href="https://www.danskerhverv.dk/"><img alt="Dansk Erhverv" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_01.png"></a> 184 <a target="_blank" href="https://www.hk.dk/omhk/sektor/handel"><img alt="HK Handel" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_03.png"></a> 185 <a target="_blank" href="https://www.lederne.dk/"><img alt="Lederne" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_05.png"></a> 186 <a target="_blank" href="https://www.nnf.dk/"><img alt="NNF" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_07.png"></a> 187 <a target="_blank" href="https://www.drivkraftdanmark.dk/"><img alt="Drifkraft Danmark" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_09.png"></a> 188 <a target="_blank" href="https://serviceforbundet.dk/"><img alt="Service Forbundet" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_11.png"></a> 189 <a target="_blank" href="http://www.danskeslagtermestre.dk/"><img alt="Danske Slagtermestre" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_13.png"></a> 190 <a target="_blank" href="https://www.bkd.dk/"><img alt="BKD" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_15.png"></a> 191 <a target="_blank" href="https://www.ba.dk/"><img alt="BA" src="/Files/Templates/Designs/barhandel2017/images/logos2/logoer_17.png"></a> 192 193 </div> 194 </div> 195 </footer> 196 <div id="search-container"> 197 <div class="status">Søger, vent venligst...</div> 198 <div class="results"></div> 199 <div class="no-results">Ingen resultater...</div> 200 </div> 201 <div id="nyhedsbrev-popup"> 202 <div class="close"></div> 203 <!--@Global:Paragraph.Content(38858)--> 204 </div> 205 <div id="share-popup"> 206 <div class="close"></div> 207 <form action="/Admin/Public/FormMailer.aspx" method="post"> 208 <input type="hidden" name="FM_Charset" value="iso-8859-1"> 209 <input type="hidden" name="FM_html" value="true"> 210 <input type="hidden" name="FM_Subject" value="BAR Handel tip!"> 211 <input type="hidden" name="FM_Template" value="barhandel2014_tip.html"> 212 <input type="hidden" name="FM_page_url" value="<!--@Global:Request.AbsoluteUri-->"> 213 <input type="hidden" name="FM_page_name" value="<!--@Title-->"> 214 215 <!--Redirect after successful submit--> 216 <!-- input type="hidden" name="FM_Redirect" value="http://www.dynamicweb.dk" --> 217 218 <table><tr><td> 219 <div class="description">Send denne side til en ven eller kollega.</div> 220 <div><input type="text" name="FM_FromName" data-placeholder="Dit navn"></div> 221 <div><input type="text" name="FM_FromEmail" data-placeholder="Din email"></div> 222 <div><input type="text" name="FM_ToName" data-placeholder="Modtagers navn"></div> 223 <div><input type="text" name="FM_ToEmail" data-placeholder="Modtagers email"></div> 224 <div><input type="submit" value="Send link"></div> 225 </td></tr></table> 226 227 </form> 228 </div> 229 <div id="download-liste"> 230 <div class="close-btn"><a href="#"><img src="/Files/Templates/Designs/barhandel2017/images/close-x.png"></a></div> 231 <div class="text">Du har <span class="document-count">0 dokumenter</span><br>på din download-liste</div> 232 <div class="show-list"><a href="#">Vis liste</a></div> 233 <div class="list"></div> 234 <div class="download-button"><form id="downloadform" action="/Default.aspx?ID=16052" method="post" target="downloadframe"><input name="ID" value="16052" type="hidden"><input id="downloadfiles" name="downloadfiles" type="hidden"><a href="#" class="main-button">Hent dokumenter</a></form></div> 235 <div style="display:none"><iframe id="downloadframe" name="downloadframe" src=""></iframe></div> 236 </div> 237 <!-- Tooltip --> 238 <!--@Global:Paragraph.Content(35143)--> 239 <script src="/Files/Templates/Designs/barhandel2017/js/vendor/fastclick.js"></script> 240 241 <script src="/Files/Templates/Designs/barhandel2017/js/vendor/jquery.velocity.min.js"></script> 242 <script src="/Files/Templates/Designs/barhandel2017/js/vendor/velocity.ui.js"></script> 243 244 <script src="/Files/Templates/Designs/barhandel2017/js/awesome-menu.js"></script> 245 <script src="/Files/Templates/Designs/barhandel2017/js/main.js?v=20210121b"></script> 246 <script src="/Files/Templates/Designs/barhandel2017/js/jquery.google-analytics.reading-tracker.js"></script> 247 248 <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> 249 @* <script> 250 (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= 251 function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; 252 e=o.createElement(i);r=o.getElementsByTagName(i)[0]; 253 e.src='//www.google-analytics.com/analytics.js'; 254 r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); 255 ga('create','UA-7643125-5');ga('send','pageview'); 256 </script> *@ 257 </body> 258 </html>