Exception in template (Designs/McHutch/_parsed/index.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Frontend.PageView.SetID()
   at Dynamicweb.Frontend.PageView.Load()
   at Dynamicweb.Frontend.PageView.GetPageviewByPageID(Int32 PageID, IDictionary values, Boolean useCache)
   at Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Int32 pageID)
   at CompiledRazorTemplates.Dynamic.cdcddddecfdc.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Web; @{ string str_htmlTitle = String.Format("{0} - {1}", GetString("Item.Area.CompanyName"), GetString("Title")); string str_topSlideshowClass = "inner"; if (GetInteger("DwAreaFirstPageID") == Dynamicweb.Frontend.PageView.Current().Page.ID) { str_topSlideshowClass = "home"; } var obj_socialNetworks = GetLoop("Item.Area.Social").ToList(); string str_minifierCss = "/public/aTools.ashx?a=min&amp;c=0&amp;f=/Files/Templates/Designs/McHutch/css/&amp;ex=_bak,ie.css"; string str_headerClass = "col-sm-6"; string str_companyName = GetString("Item.Area.CompanyName"); string str_websiteLogo = GetString("Item.Area.Logo"); string str_imageTop = GetString("Item.Area.Top_Image"); string str_imageBottom = GetString("Item.Area.Bottom_Image"); string str_website = GetString("Item.Area.Website"); string str_logoHref = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Convert.ToInt32(Pageview.Area.Values["areafirstactivepage"])); string str_favicon = "/Files/Templates/Designs/McHutch/images/favicon"; str_favicon += str_website != "Vaughan" ? ".ico" : "-v.ico"; str_minifierCss += str_website != "Vaughan" ? ",Vaughan" : ""; this.Model.Template.SetTag("Title", str_htmlTitle); } <!DOCTYPE html> <!--[if lt IE 8 ]><html class="ie7" lang='@GetGlobalValue("Global:Area.LongLang")'><![endif]--><!--[if IE 8 ]><html class="ie8" lang='@GetGlobalValue("Global:Area.LongLang")'><![endif]--><!--[if IE 9 ]><html class="ie9" lang='@GetGlobalValue("Global:Area.LongLang")'><![endif]--><!--[if (gt IE 9)|!(IE)]><!--> <html lang='@GetGlobalValue("Global:Area.LongLang")' data-backgroundimage="@str_imageTop"> <!--<![endif]--> <head> <title>@GetValue("Title")</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @GetString("MetaTags") @GetString("CopyRightNotice") @GetString("Stylesheets") <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> <link rel="shortcut icon" href="@str_favicon" type="image/x-icon"> <link rel="stylesheet" type="text/css" href="@str_minifierCss"> <script type="text/javascript" src="/public/aTools.ashx?a=min&amp;f=/Files/Templates/Designs/McHutch/js/&amp;ex=_bak,exceptions&amp;out=j&amp;m=0&amp;c=0"></script> <!--[if lte IE 9]> <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script> <script type="text/javascript" src="/Files/Templates/Designs/McHutch/js/libraries/exceptions/01_ie.js"></script> <link href="/Files/Templates/Designs/McHutch/less/ie.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]--> <script type="text/javascript"> @RenderSnippet("jsVariables") var obj_formErrorMessages = { str_errorMessagesTitle: "@(HttpUtility.JavaScriptStringEncode(Translate("errorMessagesTitle", "Error")))", str_closeWarning: "@(HttpUtility.JavaScriptStringEncode(Translate("errorMessagesCloseWarning", "close")))", str_emptyField: "@(HttpUtility.JavaScriptStringEncode(Translate("emptyField", "Empty fields")))", str_mustBeEqual: "@(HttpUtility.JavaScriptStringEncode(Translate("equalFields", "Fields must be equal")))", str_cannotBeEqual: "@(HttpUtility.JavaScriptStringEncode(Translate("diferentFields", "Cannot be equal to")))", str_viewFullDetail: "@(HttpUtility.JavaScriptStringEncode(Translate("viewFullDetail", "View full detail")))", str_selectDefault: "@(HttpUtility.JavaScriptStringEncode(Translate("selectDefault", "Select default")))", str_invalidEmail: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidEmail", "Invalid e-mail")))", str_invalidPhoneNumber: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidPhoneNumber", "Invalid phone number")))", str_invalidDate: "@(HttpUtility.JavaScriptStringEncode(Translate("invalidDate", "Invalid date")))" }, obj_loginMessages = { str_login:"@(HttpUtility.JavaScriptStringEncode(Translate("login", "Login")))", str_emailNotExists:"@(HttpUtility.JavaScriptStringEncode(Translate("emailNotExists", "Email not exists")))", str_password:"@(HttpUtility.JavaScriptStringEncode(Translate("password", "Password")))", str_forgotPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("forgotPassword", "Forgot password?")))", str_email:"@(HttpUtility.JavaScriptStringEncode(Translate("email", "Email")))", str_username:"@(HttpUtility.JavaScriptStringEncode(Translate("username", "Username")))", str_recoverPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("recoverPassword", "Recover password")))", str_errorPassword:"@(HttpUtility.JavaScriptStringEncode(Translate("emptyPassword", "Empty password")))", str_errorEmailEmpty:"@(HttpUtility.JavaScriptStringEncode(Translate("emptyEmail", "Empty email")))", str_errorUserEmpty:"@(HttpUtility.JavaScriptStringEncode(Translate("userEmpty", "Empty user")))", str_errorEmail:"@(HttpUtility.JavaScriptStringEncode(Translate("invalidEmail", "Invalid email")))", str_fillTheFields:"@(HttpUtility.JavaScriptStringEncode(Translate("fillTheFields", "Fill the fields")))", str_wrongData:"@(HttpUtility.JavaScriptStringEncode(Translate("wrongData", "Wrong data")))" }; obj_globalBootstrapSizes = { num_screenXS: @GetInteger("Item.Area.ScreenXS"), num_screenSM: @GetInteger("Item.Area.ScreenSM"), num_screenMD: @GetInteger("Item.Area.ScreenMD"), num_screenLG: @GetInteger("Item.Area.ScreenLG"), } $(function () { @RenderSnippet("jsOnLoadVariables") @RenderSnippet("jsOnLoad") }); </script> </head> <body class="@str_website"> <h1 class="hidden">@GetString("DwPageName")</h1> <div class="container-fluid noPadding" data-backgroundimage="@str_imageBottom"> <div class="container" id="pageContent"> <header> <div id="logo" class='@str_headerClass col-xs-12 noPadding'> <a href="@str_logoHref"> <img class="img-responsive" src="@str_websiteLogo" alt="@str_companyName" title="@str_companyName"> </a> </div> <div id="headerSocialMenu" class="@str_headerClass noPadding"> @{ if (!String.IsNullOrEmpty(GetString("DwNavigation(topMenu)"))) { <nav id="topMenuNavigation" class='col-xs-12 hidden-xs noPadding'> @GetValue("DwNavigation(topMenu)") </nav> } if (obj_socialNetworks.Count > 0) { <ul id="socialNetworks"> @foreach (LoopItem i in obj_socialNetworks) { string str_href = i.GetString("Item.Area.Social.Link.Value"); string str_class = i.GetString("Item.Area.Social.Class.Value"); string str_title = i.GetString("Item.Area.Social.Name.Value"); <li> <a target="_blank" href="@str_href" class="fa fa-2x @str_class" title="@str_title"></a> </li> } </ul> } if (!String.IsNullOrEmpty(GetString("DwNavigation(menuMain)"))) { <nav class="hidden-lg hidden-md hidden-sm navbar navbar-default" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div id="navbar" class="navbar-collapse collapse" style="height:1px;"> @GetValue("DwNavigation(mainMenuMob)") </div> </nav> } } </div> @if (!String.IsNullOrEmpty(GetString("DwNavigation(menuMain)"))) { <nav id="mainNavigation" class='col-xs-12 hidden-xs noPadding'> @GetValue("DwNavigation(menuMain)") </nav> } </header> <section id="contentWrapper"> @if (!String.IsNullOrEmpty(GetString("DwContent(slideshowContent)"))) { <article id="topSlideshowContainer" class="col-xs-12 col-sm-12 col-md-12 col-lg-12 noPadding @str_topSlideshowClass"> <ul id="slideshowContent">@GetValue("DwContent(slideshowContent)")</ul> </article> } @if(!String.IsNullOrEmpty(GetString("DwContent(mainContent)"))){ <section id="mainContent" class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-md-offset-1 col-lg-offset-1">@GetValue("DwContent(mainContent)")</section> } </section> <footer id="footer"> @if (GetString("DwNavigation(footerMenu)").Length > 0) { <nav id="footerNavigation" class='col-md-12 hidden-xs'> @GetValue("DwNavigation(footerMenu)") </nav> } </footer> </div> </div> </body> </html>