Error executing template "Designs/Tjlaan2013/_parsed/SubPage-Ansoegningsblanket-Sendt.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_8d802204978a449e99949b09be2f08ca.Ansoegningsblanket.HexToBytes(String hex) in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan2013\_parsed\SubPage-Ansoegningsblanket-Sendt.parsed.cshtml:line 743
   at CompiledRazorTemplates.Dynamic.RazorEngine_8d802204978a449e99949b09be2f08ca.Ansoegningsblanket.XorDecrypt(String value) in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan2013\_parsed\SubPage-Ansoegningsblanket-Sendt.parsed.cshtml:line 779
   at CompiledRazorTemplates.Dynamic.RazorEngine_8d802204978a449e99949b09be2f08ca.Execute() in D:\home\site\wwwroot\Files\Templates\Designs\Tjlaan2013\_parsed\SubPage-Ansoegningsblanket-Sendt.parsed.cshtml:line 803
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using System.Web 3 @using Dynamicweb.Environment 4 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- COOKIE -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 6 @SnippetStart("CookieHeader") 7 @{ 8 IList<string> AllowedCookieCategories = new List<string>() { "Essential" }; 9 foreach (string s in CookieManager.GetCategories()) 10 { 11 if (s == "Essential") 12 { 13 continue; 14 } 15 else if (CookieManager.CookieOptInLevelExists && (CookieManager.GetCookieOptInLevel() == CookieOptInLevel.All || (CookieManager.CookieOptInLevelExists && System.Web.HttpContext.Current.Request.Cookies.Get("Dynamicweb.CookieOptInLevel").Value.IndexOf(s) > -1))) 16 { 17 AllowedCookieCategories.Add(s); 18 } 19 } 20 21 } 22 @SnippetEnd("CookieHeader") 23 24 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 25 @SnippetStart("Head") 26 <!-- Global site tag (gtag.js) - Google Analytics --> 27 <script async src="https://www.googletagmanager.com/gtag/js?id=UA-177744248-2"></script> 28 <script> 29 window.dataLayer = window.dataLayer || []; 30 function gtag() { dataLayer.push(arguments); } 31 gtag('js', new Date()); 32 33 gtag('config', 'UA-177744248-2'); 34 </script> 35 @SnippetEnd("Head") 36 37 @SnippetStart("Icons") 38 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("Icons_Favicon"))) 39 { 40 string favIcon = Model.Area.Item.GetString("Icons_Favicon"); 41 <link rel="shortcut icon" href="@favIcon" /> 42 } 43 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("Icons_SmartphoneIcon"))) 44 { 45 var smartphoneIcon = Model.Area.Item.GetString("Icons_SmartphoneIcon"); 46 <link rel="apple-touch-icon" href="@smartphoneIcon" /> 47 } 48 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("Icons_FacebookShareIcon"))) 49 { 50 var facebookShareIcon = Model.Area.Item.GetString("Icons_FacebookShareIcon"); 51 <link rel="image_src" href="@facebookShareIcon" /> 52 } 53 @SnippetEnd("Icons") 54 @SnippetStart("GoogleAnalytics") 55 @if (!string.IsNullOrEmpty(Model.Area.Item.GetString("Google_Analytics_Code"))) 56 { 57 <script type="text/javascript"> 58 var _gaq = _gaq || []; 59 _gaq.push(['_setAccount', '@Model.Area.Item.GetString("Google_Analytics_Code")']); 60 @if(!string.IsNullOrEmpty(Model.Area.Item.GetString("Google_Analytics_Domain"))) 61 { 62 @:_gaq.push(['_setDomainName', '@Model.Area.Item.GetString("Google_Analytics_Domain")']); 63 } 64 @{ 65 string allowLinker = Model.Area.Item.GetString("Google_Analytics_AllowLinker"); 66 if(!string.IsNullOrEmpty(allowLinker) && allowLinker != "false") 67 { 68 @: _gaq.push(['_setAllowLinker', 'true']); 69 } 70 } 71 _gaq.push(['_trackPageview']); 72 (function() { 73 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 74 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 75 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 76 })(); 77 </script> 78 } 79 @SnippetEnd("GoogleAnalytics") 80 81 @*@SnippetStart("CookieNotice") 82 @if(!string.IsNullOrEmpty(Model.Area.Item.GetString("ShowCookieNotice")) && !string.Equals(Model.Area.Item.GetString("ShowCookieNotice"), "False", StringComparison.CurrentCultureIgnoreCase)) { 83 <script src="/Files/Templates/CookieNotice/Script/jquery.cookie.js"></script> 84 <script src="/Files/Templates/CookieNotice/Script/jquery.skabertrang-cookie-notice.js"></script> 85 86 <script type="text/javascript"> 87 $(document).ready(function(){ 88 $.fn.skabertrangCookieNotice({ 89 @{ 90 string cookieIconPath = Model.Area.Item.GetString("Cookie_Icon"); 91 string closeIconPath = Model.Area.Item.GetString("Cookie_Close_Icon"); 92 string moreInfoUrl = Model.Area.Item.GetString("Cookie_More_Info_Url"); 93 string horizontalPosition = Model.Area.Item.GetString("Cookie_Horizontal_Position"); 94 string hideDelayTime = Model.Area.Item.GetString("Cookie_Initial_Hide_Delay_Time"); 95 string positionPriority = Model.Area.Item.GetString("Cookie_Auto_Adjust_Position_Priority"); 96 string showOnFirstVisit = Model.Area.Item.GetString("Cookie_Show_On_First_Visit"); 97 98 if(!string.IsNullOrEmpty(showOnFirstVisit) && !string.Equals(showOnFirstVisit, "False", StringComparison.CurrentCultureIgnoreCase)) 99 { 100 @: showOnFirstVisit: true, 101 } 102 } 103 iconPath: '@(!string.IsNullOrEmpty(cookieIconPath) ? cookieIconPath : "")', 104 closeIconPath: '@(!string.IsNullOrEmpty(closeIconPath) ? closeIconPath : "")', 105 cookiePageURL: '@(!string.IsNullOrEmpty(moreInfoUrl) ? moreInfoUrl : "")', 106 position: '@(!string.IsNullOrEmpty(horizontalPosition) ? horizontalPosition : "left")', 107 initialHideDelayTime: @(!string.IsNullOrEmpty(hideDelayTime) ? hideDelayTime : "0"), 108 109 topPositionFirstPriority: @((!string.IsNullOrEmpty(positionPriority) && positionPriority != "width") ? "true" : "false"), 110 orientation: { 111 @{ 112 string verticalPosition = Model.Area.Item.GetString("Cookie_Vertical_Position"); 113 string minTopOffset = Model.Area.Item.GetString("Cookie_Minimum_Top_Offset"); 114 string marginTopPercentage = Model.Area.Item.GetString("Cookie_Margin_Top_Percentage"); 115 } 116 position: '@(!string.IsNullOrEmpty(verticalPosition) ? verticalPosition : "bottom")', 117 minOffSet: @(!string.IsNullOrEmpty(minTopOffset) ? minTopOffset : "150"), 118 percentage: @(!string.IsNullOrEmpty(marginTopPercentage) ? marginTopPercentage : "0"), 119 @{ 120 var autoAdjustTop = Model.Area.Item.GetString("Cookie_Auto_Adjust_Top_Position"); 121 if(!string.IsNullOrEmpty(autoAdjustTop) && !string.Equals(autoAdjustTop, "False", StringComparison.CurrentCultureIgnoreCase)) 122 { 123 @: topAuto: true 124 } else { 125 @: topAuto: false 126 } 127 } 128 }, 129 text: { 130 @{ 131 string topHeadline = Model.Area.Item.GetString("Cookie_Text_Top_Headline"); 132 string topContent = Model.Area.Item.GetString("Cookie_Text_Top_Content"); 133 string bottomHeadline = Model.Area.Item.GetString("Cookie_Text_Bottom_Headline"); 134 string bottomContent = Model.Area.Item.GetString("Cookie_Text_Bottom_Content"); 135 string bottomLink = Model.Area.Item.GetString("Cookie_More_Info_Link_Text"); 136 137 @: top:{ 138 @: headline: '@(!string.IsNullOrEmpty(topHeadline) ? topHeadline : "Information")', 139 @: content: '@(!string.IsNullOrEmpty(topContent) ? topContent : "Om brug af cookies")' 140 @: }, 141 142 @: bottom: { 143 @: headline: '@(!string.IsNullOrEmpty(bottomHeadline) ? bottomHeadline : "Hjemmesiden bruger cookies")', 144 @: content: '@(!string.IsNullOrEmpty(bottomContent) ? bottomContent : "Dette website anvender cookies til f&oslash;lgende form&aring;l:<br/><br/>"+ 145 "Teknisk funktionalitet s&aring; vi kan huske dine pr&aelig;ferencer.<br /><br/>"+ 146 "Trafikm&aring;ling s&aring; vi ved, hvor mange der bes&oslash;ger vores hjemmeside, og dermed kan dokumentere dette overfor fx annonc&oslash;rer.<br />"+ 147 "<br />Cookies er en fil, som l&aelig;gges p&aring; din computer eller andet IT udstyr. Den g&oslash;r det muligt at genkende din computer og samle information om hvilke sider og funktioner der bes&oslash;ges med din browser. Men cookies kan ikke se, hvem du er, hvad du hedder, hvor du bor eller om computeren bruges af en eller flere personer. Den kan heller ikke sprede computervirus eller andre skadelige programmer."+ 148 "<br /><br/>"+ 149 "<b>Hvis du klikker videre p&aring; siden, accepterer du vores brug af cookies.</b>"+ 150 "<br />"+ 151 "<br />"+ 152 "Vil du vide mere om vores cookies, og hvordan du sletter dem, ")', 153 @: link: '@(!string.IsNullOrEmpty(bottomLink) ? bottomLink : "klik her")' 154 @: } 155 } 156 }, 157 css: { 158 headline: { 159 @{ 160 string headlineColor = Model.Area.Item.GetString("Cookie_Css_Headline_Color"); 161 string headlineLineHeight = Model.Area.Item.GetString("Cookie_Css_Headline_LineHeight"); 162 string headlineFontSize = Model.Area.Item.GetString("Cookie_Css_Headline_FontSize"); 163 string headlineFontWeight = Model.Area.Item.GetString("Cookie_Css_Headline_FontWeight"); 164 string headlineTextTransform = Model.Area.Item.GetString("Cookie_Css_Headline_TextTransform"); 165 @: color: '@(!string.IsNullOrEmpty(headlineColor) ? headlineColor : "#000000")', 166 @: lineHeight: '@(!string.IsNullOrEmpty(headlineLineHeight) ? headlineLineHeight : "14px")', 167 @: fontSize: '@(!string.IsNullOrEmpty(headlineFontSize) ? headlineFontSize : "12px")', 168 @: fontWeight: '@(!string.IsNullOrEmpty(headlineFontWeight) ? headlineFontWeight : "bold")', 169 @: textTransform: '@(!string.IsNullOrEmpty(headlineTextTransform) ? headlineTextTransform : "uppercase")' 170 } 171 }, 172 content: { 173 @{ 174 string contentColor = Model.Area.Item.GetString("Cookie_Css_Content_Color"); 175 string contentLineHeight = Model.Area.Item.GetString("Cookie_Css_Content_LineHeight"); 176 string contentFontSize = Model.Area.Item.GetString("Cookie_Css_Content_FontSize"); 177 string contentFontWeight = Model.Area.Item.GetString("Cookie_Css_Content_FontWeight"); 178 @: color: '@(!string.IsNullOrEmpty(contentColor) ? contentColor : "#000000")', 179 @: lineHeight: '@(!string.IsNullOrEmpty(contentLineHeight) ? contentLineHeight : "14px")', 180 @: fontSize: '@(!string.IsNullOrEmpty(contentFontSize) ? contentFontSize : "12px")', 181 @: fontWeight: '@(!string.IsNullOrEmpty(contentFontWeight) ? contentFontWeight : "normal")' 182 } 183 }, 184 @{ 185 string cssFontFamily = Model.Area.Item.GetString("Cookie_Css_FontFamily"); 186 string cssColor = Model.Area.Item.GetString("Cookie_Css_Color"); 187 string cssBackgroundColor = Model.Area.Item.GetString("Cookie_Css_BackgroundColor"); 188 string cssBorderRadius = Model.Area.Item.GetString("Cookie_Css_BorderRadius"); 189 string cssWidth = Model.Area.Item.GetString("Cookie_Css_Width"); 190 string autoAdjustWidth = Model.Area.Item.GetString("Cookie_Auto_Adjust_Width"); 191 string cssLinkColor = Model.Area.Item.GetString("Cookie_Css_LinkColor"); 192 193 @: fontFamily: '@(!string.IsNullOrEmpty(cssFontFamily) ? cssFontFamily : "Arial,Sans-Serif")', 194 @: border: '@(!string.IsNullOrEmpty(cssColor) ? cssColor : "3px solid #45ABD7")', 195 @: backgroundColor: '@(!string.IsNullOrEmpty(cssBackgroundColor) ? cssBackgroundColor : "#FFFFFF")', 196 @: borderRadius: '@(!string.IsNullOrEmpty(cssBorderRadius) ? cssBorderRadius : "10px")', 197 @: width: '@(!string.IsNullOrEmpty(cssWidth) ? cssWidth : "230px")', 198 @: widthAuto: @((!string.IsNullOrEmpty(autoAdjustWidth) && !string.Equals(autoAdjustWidth, "False", StringComparison.CurrentCultureIgnoreCase)) ? "true" : "false"), 199 @: linkColor: '@(!string.IsNullOrEmpty(cssLinkColor) ? cssLinkColor : "#0026FF")' 200 } 201 }, 202 seen: false 203 }); 204 }); 205 </script> 206 } 207 @SnippetEnd("CookieNotice")*@ 208 209 210 211 @SnippetStart("CookieNotice") 212 @{ 213 //var categories = Dynamicweb.Environment.CookieManager.GetCategories(); 214 string cookieChoiceId = "cookie-choice-renew"; 215 string cookieWarningClass = "custom-cookie"; 216 if (Dynamicweb.Environment.CookieManager.CookieOptInLevelExists) 217 { 218 cookieWarningClass += " \" style=\"display:none\" tab-index=\"-1\" aria-hidden=\"true\""; 219 } 220 else 221 { 222 cookieChoiceId += "\" style=\"display:none;"; 223 } 224 var cookieSettingsPage = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "cookiesettings"); 225 bool cookieActivated = cookieSettingsPage != null && cookieSettingsPage.Item["CookieActivated"] != null ? (bool)cookieSettingsPage.Item["CookieActivated"] : false; 226 } 227 228 @if (cookieActivated && cookieSettingsPage != null && cookieSettingsPage.Item["CookieCategories"] != null) 229 { 230 var cookieCategoryItems = Dynamicweb.Content.Items.ItemList.GetItemListById((int)cookieSettingsPage.Item["CookieCategories"]).Relations; 231 if (cookieCategoryItems.Any()) 232 { 233 <div id="@cookieChoiceId" title="Cookie valg" aria-label="renew-consent" style="height:35px;width:35px;z-index:500;"> 234 <svg class="svg-inline--fa fa-cookie-bite fa-w-16" aria-hidden="true" focusable="false" data-prefix="fal" data-icon="cookie-bite" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M352 328c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zM184 192c0-13.26-10.75-24-24-24s-24 10.74-24 24c0 13.25 10.75 24 24 24s24-10.75 24-24zm8 136c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zm96-96c-13.25 0-24 10.74-24 24 0 13.25 10.75 24 24 24s24-10.75 24-24c0-13.26-10.75-24-24-24zm222.52 23.82c-69.97-.85-126.47-57.69-126.47-127.86-70.17 0-127-56.49-127.86-126.45C249.57.5 242.9 0 236.26 0c-20.68 0-41.18 4.85-59.79 14.33l-69.13 35.22a132.221 132.221 0 0 0-57.79 57.81l-35.1 68.88a132.645 132.645 0 0 0-12.82 80.95l12.08 76.28a132.555 132.555 0 0 0 37.16 72.96l54.77 54.76a132.036 132.036 0 0 0 72.71 37.06l76.71 12.14c6.86 1.09 13.76 1.62 20.64 1.62 20.72 0 41.25-4.88 59.89-14.38l69.13-35.22a132.221 132.221 0 0 0 57.79-57.81l35.1-68.88c12.56-24.63 17.01-52.57 12.91-79.9zm-41.42 65.36L434 390.07c-9.68 19-24.83 34.15-43.81 43.82l-69.13 35.22C307.08 476.23 291.39 480 275.7 480c-5.21 0-10.47-.41-15.63-1.23l-76.7-12.14c-21-3.33-40.05-13.04-55.09-28.08l-54.77-54.76c-15.1-15.09-24.84-34.23-28.18-55.33l-12.08-76.27c-3.35-21.12.02-42.36 9.72-61.41l35.1-68.88c9.68-19 24.83-34.15 43.81-43.82L191 42.85c11.33-5.77 23.8-9.33 36.51-10.46 13.15 63.15 63.84 112.95 127.25 124.86 11.91 63.42 61.71 114.11 124.87 127.25-1.1 12.73-4.64 25.14-10.53 36.68z"></path></svg> 235 </div> 236 <div id="cookieWarningContainer" class="@cookieWarningClass"> 237 <form id="cookieWarningForm" method="post" action="/Admin/Public/CookieOptInLevelConfig.aspx"> 238 <input type="hidden" name="cmd" value="SetCookieOptInLevel" /> 239 <input type="hidden" name="OptInLevel" id="OptInLevel" value="1" /> 240 241 <fieldset> 242 <div class="p-4"> 243 <div class="row"> 244 <div class="col-xs-12"> 245 <h2>@cookieSettingsPage.Item["CookieHeader"]</h2> 246 @cookieSettingsPage.Item["CookieIntro"] 247 <hr class="mt-4 mb-4 w-100" /> 248 <p class="text-center"> 249 <button type="button" class="btn btn-primary-naked ml-3" onclick="setOptInCookie(1);">@Translate("Tillad valgte")</button> 250 <button type="button" class="rm-button btn btn-primary ml-3" onclick="setOptInCookie(2);">@Translate("Tillad alle")</button> 251 </p> 252 253 </div> 254 </div> 255 </div> 256 @{ 257 string showDetails = Translate("Vis detaljer"); 258 string hideDetails = Translate("Skjul detaljer"); 259 <div class="p-4"> 260 <div class="grid"> 261 @foreach (Dynamicweb.Content.Items.Item category in cookieCategoryItems) 262 { 263 string categoryName = "" + category["Name"]; 264 string categorySysName = "" + category["SysName"]; 265 string categoryID = "cookecategory-" + category.Id; 266 string categoryDescription = "" + category["Description"]; 267 var cookies = Dynamicweb.Content.Items.ItemList.GetItemListById((int)category["Cookies"]).Relations; 268 269 if (cookies.Any()) 270 { 271 <div class="col-xs-4"> 272 <div class="custom-control custom-checkbox text-center" data-nogutter="1"> 273 <span class="d-block">@categoryName</span> 274 @if (categorySysName == "Essential") 275 { 276 <input type="checkbox" class="custom-control-input" id="chk-cookie-@categorySysName" value="@categorySysName" checked="checked" disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled disabled= disabled /> 277 } 278 else 279 { 280 if (AllowedCookieCategories.Contains(categorySysName)) 281 { 282 <input type="checkbox" class="custom-control-input" checked="checked" id="chk-cookie-@categorySysName" name="OptInCategory" value="@categorySysName" /> 283 } 284 else 285 { 286 <input type="checkbox" class="custom-control-input" id="chk-cookie-@categorySysName" name="OptInCategory" value="@categorySysName" /> 287 } 288 } 289 <label class="custom-control-label" for="chk-cookie-@categorySysName"></label> 290 </div> 291 </div> 292 } 293 } 294 295 </div> 296 <div class="row"> 297 <div class="col-xs-12"> 298 <hr class="mt-4 mb-4 w-100" /> 299 <p class="text-center"> 300 <button class="btn btn-primary-naked collapsed" id="cookie-details-button" data-toggle="collapse" role="button" aria-expanded="false" data-open-text="@showDetails" data-close-text="@hideDetails" aria-controls="collapse-cookie-info-container"> 301 @showDetails 302 </button> 303 </p> 304 </div> 305 </div> 306 </div> 307 <div class="collapse" id="collapse-cookie-info-container"> 308 <div class="cookie-info-container"> 309 <div class="mb-4"> 310 @foreach (Dynamicweb.Content.Items.Item category in cookieCategoryItems) 311 { 312 string categoryName = "" + category["Name"]; 313 string categorySysName = "" + category["SysName"]; 314 string categoryID = "cookecategory-" + category.Id; 315 string categoryDescription = "" + category["Description"]; 316 var cookies = Dynamicweb.Content.Items.ItemList.GetItemListById((int)category["Cookies"]).Relations; 317 if (cookies.Any()) 318 { 319 <div class="d-block toogle-f-content" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapse-cookie-info-@categoryID"> 320 <div class="row"> 321 <div class="col-xs-12 col-sm-3 cookie-info-container-title"> 322 @*<span class="arrow-animate-down"><span class="icon-bar"></span><span class="icon-bar"></span></span>*@ 323 <i class="fa fa-angle-right" aria-hidden="true"></i> 324 325 <strong>@categoryName</strong> 326 327 </div> 328 <div class="col-xs-12 col-sm-9"> 329 @categoryDescription 330 </div> 331 </div> 332 </div> 333 <div class="collapse" id="collapse-cookie-info-@categoryID"> 334 @foreach (Dynamicweb.Content.Items.Item cookie in cookies) 335 { 336 string titleClass = "col-xs-12 col-sm-3"; 337 string contentClass = "col-xs-12 col-sm-9"; 338 339 <div class="grid p-1"> 340 <div class="row collapse-cookie-info-header"> 341 <div class="@titleClass"> 342 <strong> 343 @Translate("Databehandler") 344 </strong> 345 </div> 346 <div class="@contentClass"> 347 <p>@cookie["DataProcessor"]</p> 348 </div> 349 </div> 350 <div class="row"> 351 <div class="@titleClass"> 352 <strong> 353 @Translate("Formål") 354 </strong> 355 </div> 356 <div class="@contentClass"> 357 @cookie["Purpose"] 358 </div> 359 <div class="@titleClass"> 360 <strong> 361 @Translate("Privatlivspolitik:") 362 </strong> 363 </div> 364 <div class="@contentClass"> 365 <p><a target="_blank" href="@cookie["PrivacyPolicy"]">@cookie["PrivacyPolicy"]</a></p> 366 </div> 367 <div class="@titleClass"> 368 <strong> 369 @Translate("Udløb") 370 </strong> 371 </div> 372 <div class="@contentClass"> 373 <p>@cookie["Expires"]</p> 374 </div> 375 <div class="@titleClass"> 376 <strong> 377 @Translate("Navn") 378 </strong> 379 </div> 380 <div class="@contentClass"> 381 <p>@cookie["Name"]</p> 382 </div> 383 <div class="@titleClass"> 384 <strong> 385 @Translate("Udbyder") 386 </strong> 387 </div> 388 <div class="@contentClass"> 389 <p>@cookie["Provider"]</p> 390 </div> 391 </div> 392 </div> 393 } 394 </div> 395 } 396 } 397 </div> 398 </div> 399 </div> 400 401 } 402 </fieldset> 403 </form> 404 405 <script> 406 document.getElementById("cookie-choice-renew").onclick = function () { 407 showCookieChoice(); 408 }; 409 document.getElementById("cookie-details-button").onclick = function () { 410 411 if (this.classList.contains("opened")) { 412 this.text = this.getAttribute("data-open-text"); 413 this.classList.remove("opened"); 414 document.getElementById("collapse-cookie-info-container").classList.remove("show"); 415 } else { 416 this.text = this.getAttribute("data-close-text"); 417 this.classList.add("opened"); 418 419 document.getElementById("collapse-cookie-info-container").classList.add("show"); 420 } 421 }; 422 var cookieExtraInfoElements = document.getElementsByClassName("toogle-f-content"); 423 for (var i = 0; i < cookieExtraInfoElements.length; i++) { 424 425 cookieExtraInfoElements[i].onclick = function () { 426 var elementToToggle = this.getAttribute("aria-controls"); 427 if (this.classList.contains("opened")) { 428 this.classList.remove("opened"); 429 document.getElementById(elementToToggle).classList.remove("show"); 430 } else { 431 this.classList.add("opened"); 432 document.getElementById(elementToToggle).classList.add("show"); 433 } 434 } 435 } 436 437 438 function setOptInCookie(optInLevel) { 439 document.getElementById("OptInLevel").value = optInLevel; 440 var formElement = document.getElementById("cookieWarningForm"); 441 if (optInLevel == 1) { 442 var essentialElement = document.createElement('input'); 443 if (document.getElementById('cookie-essential') === null) { 444 essentialElement.setAttribute("name", "OptInCategory"); 445 essentialElement.setAttribute("value", "Essential"); 446 essentialElement.setAttribute("type", "hidden"); 447 essentialElement.setAttribute("id", "cookie-essential"); 448 formElement.appendChild(essentialElement); 449 } 450 451 if (document.getElementById("chk-cookie-Marketing") != null && document.getElementById("chk-cookie-Marketing").checked && typeof fbq !== 'undefined') { 452 fbq('consent', 'grant'); 453 } 454 } 455 if (optInLevel == 2) { 456 if(document.getElementById("chk-cookie-Statistical") != null){ 457 document.getElementById("chk-cookie-Statistical").checked = true; 458 } 459 if(document.getElementById("chk-cookie-Marketing") != null){ 460 document.getElementById("chk-cookie-Marketing").checked = true; 461 } 462 463 if (typeof fbq !== 'undefined') { 464 fbq('consent', 'grant'); 465 } 466 467 } 468 var formData = new FormData(formElement); 469 470 var xmlhttp = new XMLHttpRequest(); 471 xmlhttp.onreadystatechange = function () { 472 if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 473 hideCookieChoice(); 474 return false; 475 } 476 } 477 478 xmlhttp.open(formElement.method, formElement.action); 479 xmlhttp.send(formData); 480 481 return false; 482 } 483 function showCookieChoice() { 484 485 var cookieWarningContainer = document.getElementById("cookieWarningContainer"); 486 cookieWarningContainer.style.display = "flex"; 487 cookieWarningContainer.removeAttribute("tab-index"); 488 cookieWarningContainer.removeAttribute("aria-hidden"); 489 if(document.getElementById("cookie-choice-renew") != null){ 490 document.getElementById("cookie-choice-renew").style.display = "none"; 491 } 492 493 } 494 function hideCookieChoice() { 495 496 var cookieWarningContainer = document.getElementById("cookieWarningContainer"); 497 cookieWarningContainer.style.display = "none"; 498 cookieWarningContainer.setAttribute("tab-index", "-1"); 499 cookieWarningContainer.setAttribute("aria-hidden", "true"); 500 501 if(document.getElementById("cookie-choice-renew") != null){ 502 document.getElementById("cookie-choice-renew").style.display = "block"; 503 } 504 505 } 506 </script> 507 </div> 508 } 509 510 } 511 @* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- *@ 512 @SnippetEnd("CookieNotice") 513 514 515 @{ 516 var url = HttpContext.Current.Request.Url.ToString(); 517 518 if(url.IndexOf("©") > -1) { 519 url = url.Replace("©", "&copy"); 520 521 HttpContext.Current.Response.Redirect(url); 522 HttpContext.Current.Response.End(); 523 return; 524 } 525 string designBasePath = Pageview.Layout.File.Location; 526 527 //<ul class="dwnavigation" id="serviceMenu" settings="endlevel:1;parenttag:topbarnav;"></ul> 528 var servicemenu = RenderNavigation(new { 529 id = "serviceMenu", 530 parenttag = "topbarnav", 531 endlevel = 1 532 }); 533 534 //<ul class="dwnavigation nav navbar-nav" id="topmenu" settings="startlevel:1;endlevel:2;expandmode:all;template:mainmenu.xslt"></ul> 535 var topmenu = RenderNavigation(new { 536 id = "topmenu", 537 startLevel = 1, 538 expandmode = "all", 539 endlevel = 2, 540 template = "mainmenu.xslt" 541 }); 542 543 //<ul class="dwnavigation" id="sitemap-footer" settings="startlevel:0;endlevel:3;expandmode:all;template:footer.xslt;"></ul> 544 var sitemapfooter = RenderNavigation(new { 545 id = "sitemap-footer", 546 startLevel = 0, 547 expandmode = "all", 548 endlevel = 3, 549 template = "footer.xslt" 550 }); 551 } 552 @RenderSnippet("CookieHeader") 553 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 554 <!--[if lt IE 7]> <html lang="en-us" class="no-js lt-ie11 lt-ie10 ie6 lt-ie9 lt-ie8 lt-ie7 oldie"> <![endif]--> 555 <!--[if IE 7]> <html lang="en-us" class="no-js lt-ie11 lt-ie10 ie7 lt-ie9 lt-ie8 oldie"> <![endif]--> 556 <!--[if IE 8]> <html lang="en-us" class="no-js ie8 lt-ie11 lt-ie10 lt-ie9 oldie"> <![endif]--> 557 <!--[if IE 9]> <html lang="en-us" class="no-js ie9 lt-ie11 lt-ie10 oldie"> <![endif]--> 558 <!--[if IE 10]> <html lang="en-us" class="no-js ie10 lt-ie11"> <![endif]--> 559 <!--[if gt IE 10]><!--> 560 <html lang="da" class="no-js"> 561 <!--<![endif]--> 562 <head> 563 <meta charset="utf-8" /> 564 <!--meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"--> 565 <title>@Model.Title</title> 566 <meta name="robots" content="index, follow" /> 567 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 568 @Model.MetaTags 569 570 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" /> 571 <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> 572 573 <link href="@designBasePath/css/style.css" rel="stylesheet" /> 574 <link href="@designBasePath/css/jquery.bxslider.css" rel="stylesheet" /> 575 576 @RenderSnippet("Icons") 577 578 <link rel="stylesheet" href="https://maxcdn.icons8.com/fonts/line-awesome/1.1/css/line-awesome-font-awesome.min.css" /> 579 580 <!--Loading some needed scripts at top of page - rest before end of body tag--> 581 <!--[if lt IE 9]> 582 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 583 <![endif]--> 584 <!--[if gte IE 9]><!--> 585 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 586 <!--<![endif]--> 587 <!--[if lt IE 9]> 588 <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script> 589 <script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script> 590 <![endif]--> 591 592 @if (AllowedCookieCategories.Contains("Statistical")) 593 { 594 @RenderSnippet("Head") 595 } 596 </head> 597 <body> 598 <div id="topWrapper"> 599 <div id="top" class="siteWrapped"> 600 <div class="logo"></div> 601 <script type="text/javascript"> 602 $('.logo').click(function () { location.href = '/Default.aspx?id=1'; }); 603 </script> 604 <div id="cta"></div> 605 <div id="serviceMenuWrapper"> 606 <div id="serviceMenu"> 607 @servicemenu 608 </div> 609 </div> 610 </div> 611 612 <!--NavBar--> 613 <div id="blackMenu"> 614 <div id="menuWrapper" class="container siteWrapped"> 615 <!-- Static navbar --> 616 <div class="navbar navbar-default" id="menu"> 617 <div class="navbar-header hidden-lg hidden-md"> 618 <div class="row"> 619 <div class="col-sm-8 pull-left"> 620 <div id="search"> 621 <form id="custom-search-form" method="get" action="/Default.aspx" class="hidden-lg hidden-md hidden-sm"> 622 <div class="input-append"> 623 <input type="hidden" name="ID" value="7" /> 624 <input type="text" class="search-query" name="q" placeholder="S&oslash;g" /> 625 <button type="submit" class="btn"><i class="fa fa-search"></i></button> 626 </div> 627 </form> 628 </div> 629 </div> 630 631 <div class="col-sm-4"> 632 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 633 <span class="icon-bar"></span> 634 <span class="icon-bar"></span> 635 <span class="icon-bar"></span> 636 </button> 637 </div> 638 </div> 639 </div> 640 <div class="navbar-collapse collapse"> 641 @topmenu 642 <div id="search" class="hidden-xs"> 643 <form id="custom-search-form" method="get" action="/Default.aspx"> 644 <div class="input-append"> 645 <input type="hidden" name="ID" value="7" /> 646 <input type="text" class="search-query" name="q" placeholder="S&oslash;g" /> 647 <button type="submit" class="btn"><i class="fa fa-search"></i></button> 648 </div> 649 </form> 650 </div> 651 </div> 652 </div> 653 </div> 654 </div> 655 </div> 656 657 <div id="siteWrapper" class="siteWrapped"> 658 <div id="contentWrapper"> 659 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 660 661 @using System.Data.SqlClient 662 @using System.Text 663 @functions { 664 public class Ansoegningsblanket { 665 public int id { get; set; } 666 public string navn { get; set; } 667 public string bopael { get; set; } 668 public string postnummer { get; set; } 669 public string by { get; set; } 670 public string telefonnummer { get; set; } 671 public string mobiltelefonnummer { get; set; } 672 public string email { get; set; } 673 public string cprnummer { get; set; } 674 public string fil { get; set; } 675 public string anbefaler { get; set; } 676 public DateTime anbefaler_dato { get; set; } 677 public string kommentar { get; set; } 678 public DateTime _dato { get; set; } 679 public string _ip { get; set; } 680 public string _browser { get; set; } 681 public string _data { get; set; } 682 683 public static Ansoegningsblanket LoadBlanket(int rowId) { 684 return LoadBlanket("2016", rowId); 685 } 686 687 public static Ansoegningsblanket LoadBlanket(string suffix, int rowId) { 688 using (var connection = Dynamicweb.Data.Database.CreateConnection()) { 689 using (var command = connection.CreateCommand()) { 690 command.CommandText = "SELECT * FROM Ansoegningsblanket_" + suffix + " WHERE Ansoegningsblanket_" + suffix + "ID = @id"; 691 692 command.Parameters.Add(new SqlParameter("@id", rowId)); 693 694 using (var reader = command.ExecuteReader()) { 695 if (reader.Read()) { 696 return new Ansoegningsblanket { 697 id = reader.GetInt32(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "ID")), 698 navn = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Navn")), 699 bopael = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Bopael")), 700 postnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Postnummer")), 701 by = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_By")), 702 telefonnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Telefonnummer")), 703 mobiltelefonnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Mobiltelefonnummer")), 704 email = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Email")), 705 cprnummer = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_CPRnummer")), 706 fil = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Fil")), 707 anbefaler = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler")), 708 anbefaler_dato = reader.IsDBNull(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler_Dato")) ? DateTime.MinValue : reader.GetDateTime(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Anbefaler_Dato")), 709 kommentar = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "_Kommentar")), 710 _dato = reader.GetDateTime(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Dato")), 711 _ip = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__IP")), 712 _browser = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Browser")), 713 _data = reader.GetString(reader.GetOrdinal("Ansoegningsblanket_" + suffix + "__Data")) 714 }; 715 } 716 } 717 } 718 } 719 720 return null; 721 } 722 723 private static int[] XorKeys { 724 get { 725 return new[] { 210, 184, 99, 118, 57, 160, 85, 172, 21, 155, 114, 183, 208, 102, 176, 49 }; 726 } 727 } 728 729 private static string BytesToHex(byte[] bytes) { 730 var c = new char[bytes.Length * 2]; 731 732 for (var i = 0; i < bytes.Length; i++) { 733 var b = (byte)(bytes[i] >> 4); 734 c[i * 2] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30); 735 b = (byte)(bytes[i] & 0xF); 736 c[i * 2 + 1] = (char)(b > 9 ? b + 0x37 + 0x20 : b + 0x30); 737 } 738 739 return new string(c); 740 } 741 742 private static byte[] HexToBytes(string hex) { 743 var bytes = new byte[hex.Length / 2]; 744 745 for (var i = 0; i < bytes.Length; i++) { 746 var c = hex[i * 2]; 747 bytes[i] = (byte)((c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')) << 4); 748 c = hex[i * 2 + 1]; 749 bytes[i] |= (byte)(c > '9' ? (c > 'Z' ? (c - 'a' + 10) : (c - 'A' + 10)) : (c - '0')); 750 } 751 752 return bytes; 753 } 754 755 public static string XorEncrypt(string value) 756 { 757 var buffer = Encoding.UTF8.GetBytes(value); 758 var hashed = new byte[buffer.Length + 16]; 759 var keys = XorKeys; 760 var salt = (Guid.NewGuid()).ToByteArray(); 761 var j = 0; 762 763 for (var i = 0; i < 8; i++) { 764 hashed[i] = (byte)(salt[i] ^ (uint)keys[i]); 765 hashed[i + 8 + buffer.Length] = (byte)(salt[i + 8] ^ (uint)keys[i + 8]); 766 } 767 768 for (var i = 0; i < buffer.Length; i++) { 769 if (j >= 16) 770 j = 0; 771 hashed[i + 8] = (byte)((buffer[i] ^ (uint)salt[j]) ^ 135u); 772 j++; 773 } 774 775 return BytesToHex(hashed); 776 } 777 778 public static string XorDecrypt(string value) { 779 var hashed = HexToBytes(value); 780 var buffer = new byte[hashed.Length - 16]; 781 var keys = XorKeys; 782 var salt = new byte[16]; 783 var j = 0; 784 785 for (var i = 0; i < 8; i++) { 786 salt[i] = (byte)(hashed[i] ^ (uint)keys[i]); 787 salt[i + 8] = (byte)(hashed[i + 8 + buffer.Length] ^ (uint)keys[i + 8]); 788 } 789 790 for (var i = 0; i < buffer.Length; i++) { 791 if (j >= 16) 792 j = 0; 793 buffer[i] = (byte)((hashed[i + 8] ^ 135u) ^ salt[j]); 794 j++; 795 } 796 797 return Encoding.UTF8.GetString(buffer); 798 } 799 } 800 } 801 @using System.Web 802 @{ 803 var rowId = Ansoegningsblanket.XorDecrypt(HttpContext.Current.Request.QueryString["rId"]).Split(':')[1]; 804 var blanket = string.IsNullOrWhiteSpace(rowId) ? null : Ansoegningsblanket.LoadBlanket("2016", int.Parse(rowId)); 805 806 var leftnav = RenderNavigation(new { 807 id = "leftnav", 808 startLevel = 2, 809 expandmode = "path", 810 endlevel = 10, 811 template = "LIClean.xslt" 812 }); 813 var breadcrumbnav = RenderNavigation(new { 814 id = "breadcr", 815 startLevel = 1, 816 expandmode = "path", 817 endlevel = 4, 818 template = "Breadcrumb.xslt", 819 sitemapmode = "true" 820 }); 821 } 822 823 <div id="leftColumnWrapper" class="sideColumnWrapper"> 824 <div id="leftColumnHeader" class="leftnav"> 825 <h4>@Model.TopPage.Name</h4> 826 </div> 827 <div class="leftnav"> 828 @leftnav 829 </div> 830 <div id="leftColumn" class="leftColumn"> 831 @Model.Placeholder("leftColumn", "Venstre Menu", "template:/Paragraph/CleanParagraph.cshtml") 832 </div> 833 </div> 834 835 <div id="center3ColumnWrapper" class="centerColumnWrapper"> 836 <div id="breadcrumb"> 837 @breadcrumbnav 838 </div> 839 840 <div id="centerColumn" class="centerColumn"> 841 @Model.Placeholder("centerColumn", "Indhold", "template:/Paragraph/CleanParagraph.cshtml;default:true") 842 </div> 843 844 @if(blanket != null) { 845 var datajson = Newtonsoft.Json.Linq.JObject.Parse(blanket._data); 846 var data_GenerateSend = (string)datajson["_Data_GenerateSend"]["value"]; 847 var cryptId = Ansoegningsblanket.XorEncrypt(DateTime.Now.Ticks + ":" + blanket.id); 848 849 <style type="text/css"> 850 #centerColumn { 851 min-height: auto; 852 } 853 </style> 854 855 if(data_GenerateSend == "PDF") { 856 <h1>Du har valgt at sende fysisk</h1> 857 <p>Tak for udfyldelse af lånansøgningen. Du kan ved klik på nedenstående link, printe eller gemme din låneansøgning. Låneansøgningen sender du efterfølgende pr. brev eller via en e-mail til din kontaktperson.</p> 858 <a href="/Admin/Public/Ansoegningsblanket_2016Handler.ashx?methodName=GetPDF&amp;id=@(cryptId)" class="btn btn-default" role="button" target="_blank">Print/Gem ansøgning</a> 859 } else { 860 <h1>Tak for din ansøgning, som du nu har sendt til din faglige organisation.</h1> 861 <p>Når vi modtager ansøgningen fra din organisation, behandler vi ansøgningen og sender afgørelsen til din mail.</p> 862 <p>Er lånet bevilget sender vi samtidig lånedokumenterne via E-Signatur til din mail og de skal underskrives med din NemID.</p> 863 <p>Såfremt du ikke har NemID kan dokumenterne fremsendes med post. Du skal så kontakte låneforeningens kontor.</p> 864 <p>Lånet kan først udbetales til din NemKonto når vi efterfølgende har fået noteret lånet på dit lønkontor.</p> 865 } 866 } 867 868 @RenderSnippet("SNS") 869 </div> 870 871 <div id="rightColumnWrapper" class="sideColumnWrapper"> 872 <div id="rightColumn" class="rightColumn"> 873 @Model.Placeholder("rightColumn", "Højre Menu", "template:/Paragraph/CleanParagraph.cshtml") 874 </div> 875 </div> 876 @if(false) { 877 //Simply to make it possible to select it in website settings - seems to be a bug either in 9.7 or from upgrading? 878 <div id="ignore" class="dwcontent" title="Ignore"></div> 879 } 880 </div> 881 </div> 882 883 <div id="footerWrapper"> 884 <div id="siteMapWrapper"> 885 <div id="siteMap" class="siteWrapped"> 886 @sitemapfooter 887 </div> 888 </div> 889 <div id="footerContentWrapper"> 890 <div id="footerContent" class="siteWrapped"> 891 @RenderParagraphContent(22) 892 </div> 893 </div> 894 </div> 895 <style> 896 #siteMap ul > li{float:left;} 897 #footerContent{border:none;} 898 </style> 899 <!--Scripts placed at the end of the page to make it load faster--> 900 <script src="@designBasePath/javascript/jquery.bxslider.min.js"></script> 901 <script src="@designBasePath/javascript/script.js"></script> 902 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> 903 @*@RenderSnippet("GoogleAnalytics")*@ 904 @RenderSnippet("CookieNotice") 905 </body> 906 </html>