Exception in template (eCom/Productlist/DownloadsList.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.dbdbaceadeececc.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using System; @using System.Linq; @using System.Web; @using Dynamicweb.Rendering; @using ff.CustomModules; @using ff.CustomModules.Classes; @{ var currentGroupId = GetString("Ecom:Group.ID"); var imageBankGroupId = Pageview.Area.Item["ImageBankGroupId"].ToString(); var twoDthreeDGroupId = Pageview.Area.Item["2D3DGroupId"].ToString(); bool is2d3d = currentGroupId == twoDthreeDGroupId || currentGroupId.Contains("2d3d_"); bool isImageBank = currentGroupId == imageBankGroupId || currentGroupId.Contains("imgbnk_"); bool isAdmin = false; var user = Dynamicweb.Modules.UserManagement.User.GetCurrentBackendUser(); if (user != null) { isAdmin = user.IsAdmin; } } @if (isImageBank) { <script type="text/x-handlebars-template" id="imagebank-modal-template"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <img src="{{ImageUrl}}" alt="{{ProductName}}" /> <h5>{{ProductName}}</h5> {{#if ProductDescription}} <p>{{ProductDescription}}</p> {{/if}} </div> <div class="modal-footer"> </div> </div> </div> </script> <script type="text/x-handlebars-template" id="imagebank-basket-modal-template"> <div class="modal-dialog modal-selection"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> @{ string separator = HttpContext.Current.Request.Url.ToString().Contains('?') ? "&" : "?"; string url = HttpContext.Current.Request.Url + separator + "redirect=false"; } <form name="multiForm" id="multiForm" method="post" action="@url"> <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> <input type="hidden" name="resolution" id="resolution" value="" /> <div class="download-choice high"> <a href="#" class="download-link" data-resolution="300">@Translate("ImageBankDownloadHighRes", "HIGH RESOLUTION")</a> </div> <div class="download-choice low"> <a href="#" class="download-link" data-resolution="150">@Translate("ImageBankDownloadLowRes", "LOW RESOLUTION")</a> </div> <div class="clear-selection"> <span id="delete-selection">@Translate("DeleteSelection", "Delete all your selected files")</span> </div> <div class="selection"> {{#each this}} <div class="product"> <div class="productimgbox imgbnk-img"> <img src="{{ImageUrl}}" alt="{{ProductName}}" /> </div> <div class="product-name"> <p>{{ProductName}}</p> <p class="desc">{{ProductDescription}}</p> </div> <input id="Quantity{{add @@index 1}}" type="hidden" value="1" name="Quantity{{add @@index 1}}" /> <input id="ProductLoopCounter{{add @@index 1}}" type="hidden" value="{{add @@index 1}}" name="ProductLoopCounter{{add @@index 1}}"> <input id="ProductID{{add @@index 1}}" type="hidden" value="{{ProductID}}" name="ProductID{{add @@index 1}}"> </div> {{/each}} </div> </form> @if (isAdmin) { <span id="productids" /> } </div> <div class="modal-footer"> </div> </div> </div> </script> } @if (is2d3d) { <script type="text/x-handlebars-template" id="2d3d-modal-template"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <img src="{{ImageUrl}}" alt="{{ProductName}}" /> <h5>{{ProductName}}</h5> {{#if ProductDescription}} <p>{{ProductDescription}}</p> {{/if}} </div> <div class="modal-footer"> <div class="download-choice"> @*<a href="{{DownloadUrl}}" target="_blank">@Translate("2D3DDownload", "Download file")</a>*@ </div> </div> </div> </div> </script> <script type="text/x-handlebars-template" id="2d3d-basket-modal-template"> <div class="modal-dialog modal-selection"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> @{ string separator = HttpContext.Current.Request.Url.ToString().Contains('?') ? "&" : "?"; string url = HttpContext.Current.Request.Url + separator + "redirect=false"; } <form name="multiForm" id="multiForm" method="post" action="@url"> <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" /> <input type="hidden" name="resolution" id="resolution" value="" /> <div class="download-choice"> <a href="#" class="download-link" data-resolution="">@Translate("2D3DDownloadSelection", "Download your selection")</a> </div> <div class="clear-selection"> <span id="delete-selection">@Translate("DeleteSelection", "Delete your selection")</span> </div> <div class="selection"> {{#each this}} <div class="product"> <div class="productimgbox 2d3d-img"> <img src="{{ImageUrl}}" alt="{{ProductName}}" /> </div> <div class="product-name"> <p>{{ProductName}}</p> <p class="desc">@Translate("Architect File Package")</p> </div> <input id="Quantity{{add @@index 1}}" type="hidden" value="1" name="Quantity{{add @@index 1}}" /> <input id="ProductLoopCounter{{add @@index 1}}" type="hidden" value="{{add @@index 1}}" name="ProductLoopCounter{{add @@index 1}}"> <input id="ProductID{{add @@index 1}}" type="hidden" value="{{ProductID}}" name="ProductID{{add @@index 1}}"> </div> {{/each}} </div> </form> </div> <div class="modal-footer"></div> </div> </div> </script> } @if (isImageBank || is2d3d) { <div id="group-name" style="display:none">@GetString("Ecom:Group.Name")</div> <div class="basket"> <div id="imagebank-download" style="display:none"> <p class="message"></p> </div> </div> var collections = GetLoop("Products").GroupBy(x => x.GetString("Ecom:Product:Field.Collection")); string separator = HttpContext.Current.Request.Url.ToString().Contains('?') ? "&" : "?"; string url = HttpContext.Current.Request.Url + separator + "redirect=false"; string imgClass = is2d3d ? "2d3d-img" : "imgbnk-img"; foreach (var collection in collections) { var designers = (from product in collection select product.GetString("Ecom:Product:Field.Designer")) .Union(from product in collection select product.GetString("Ecom:Product:Field.SecondDesigner")) .Where(x => !String.IsNullOrEmpty(x)) .Distinct() .ToArray(); <div class="collectioncontainer " id="[email protected](collection.Key.ToLower())"> <div class="container1015"> <h2 class="anchor">@(string.IsNullOrEmpty(collection.Key) ? "No collection name" : collection.Key)</h2> <div class="collection-by"><h5>@Translate("By", "By") @String.Join(" - ", designers)</h5></div> <div class="products"> @foreach (var item in collection.GroupBy(x => x.GetString("Ecom:Product:Field.OriginalProductName.Value"))) { <div class="master-product"> <div class="master-product-title"><h3 class="product-anchor" id="[email protected](item.Key)">@item.Key</h3></div> @if (is2d3d) { List<LoopItem> products = item.OrderBy(x => x.GetString("Ecom:Product.Name")).ToList(); foreach (var prods in products.Select(y => y.GetString("Ecom:Product:Field.ModelNumber.Value")).Distinct()) { Dynamicweb.eCommerce.Products.Product product = Dynamicweb.eCommerce.Products.Product.GetProductByNumber(prods); string data = string.Empty; data = "data-filetype=\"" + product.GetProductFieldValue("MediaType") + "\""; data += " data-file=\"" + product.GetProductFieldValue("File2D") + "\""; <div class="product download" data-image="@product.GetProductFieldValue("ListImage")" data-name="@HttpUtility.HtmlEncode(product.Name)" data-description="@HttpUtility.HtmlEncode(product.ShortDescription)" data-filters="@product.GetProductFieldValue("Filters")" @data> <div class="productimgbox @imgClass"> <img alt="@product.Name" class="b-lazy" src="/Files/Images/placeholder-image.png" data-src="@Pageview.Area.Item["PerfionApiUrl"]/Perfion/[email protected]("ListImage")&size=168x168&format=jpg&fit=fit" /> <div class="name">@Translate("Preview", "Preview")</div> </div> <input class="chk-download-choice" type="checkbox" id="[email protected]" data-productid="@product.ID" /> <div class="product-name"> <p>@product.Name</p> <p class="desc">@Translate("Architect File Package")</p> </div> </div> } } else { foreach (var product in item.OrderBy(x => x.GetString("Ecom:Product.Name")).OrderBy(x => x.GetString("Ecom:Product:Field.MediaType"))) { string data = string.Empty; <div class="product download" data-image="@product.GetString("Ecom:Product:Field.ListImage")" data-name="@HttpUtility.HtmlEncode(product.GetString("Ecom:Product.Name"))" data-description="@HttpUtility.HtmlEncode(product.GetString("Ecom:Product.ShortDescription"))" data-filters="@product.GetString("Ecom:Product:Field.Filters")" @data> <div class="productimgbox @imgClass"> <img alt="@product.GetString("Ecom:Product.Name")" class="b-lazy" src="/Files/Images/placeholder-image.png" data-src="@Pageview.Area.Item["PerfionApiUrl"]/Perfion/[email protected]("Ecom:Product:Field.ListImage")&size=168x168&format=png&fit=fit" /> <div class="name">@Translate("Preview", "Preview")</div> </div> <input class="chk-download-choice" type="checkbox" id="[email protected]("Ecom:Product.ID")" data-productid="@product.GetString("Ecom:Product.ID")" /> <div class="product-name"> <p>@product.GetString("Ecom:Product.Name")</p> <p class="desc"> @product.GetString("Ecom:Product.ShortDescription") </p> </div> </div> } } </div> } </div> </div> </div> } <div id="imagebank-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"></div> } else { <div class="download-container" id="download-container"> <div class="container"> <div class="products"> @foreach (var product in GetLoop("Products")) { string url = product.GetString("Ecom:Product:Field.CustomFile.Clean"); if (!string.IsNullOrWhiteSpace(product.GetString("Ecom:Product.MetaUrl"))) { url = product.GetString("Ecom:Product.MetaUrl"); } <div class="product"> <div class="productimgbox"> <a href="@url" target="_blank"> <img alt="@product.GetString("Ecom:Product.Name")" class="b-lazy" src="/Files/Images/placeholder-image.png" data-src="@product.GetString("Ecom:Product:Field.CustomThumbnail.Clean")" /> </a> </div> <div class="product-name"><p>@product.GetString("Ecom:Product.Name")</p></div> <div class="product-filetype"><p>@product.GetString("Ecom:Product:Field.CustomFileType.Value.Clean") &nbsp;</p></div> </div> } </div> </div> </div> } <script type="text/javascript"> PerfionApiUrl = '@Pageview.Area.Item["PerfionApiUrl"]'; GroupType = '@GetString("Ecom:Group:Field.GroupType")'; DownloadsJsonUrl = '@Pageview.Area.Item["DownloadsJsonUrl"]'; DownloadsListLabels = { ImageBankDownloadMessageSingular: '@HttpUtility.JavaScriptStringEncode(Translate("ImageBankDownloadMessageSingular", "Download selected image :"))', ImageBankDownloadMessagePlural: '@HttpUtility.JavaScriptStringEncode(Translate("ImageBankDownloadMessagePlural", "Download selected {0} images :"))', FileDownloadMessageSingular: '@HttpUtility.JavaScriptStringEncode(Translate("FileDownloadMessageSingular", "Download selected file"))', FileDownloadMessagePlural: '@HttpUtility.JavaScriptStringEncode(Translate("FileDownloadMessagePlural", "Download selected {0} files"))', ImageBank2DFileType: '@HttpUtility.JavaScriptStringEncode(Translate("FileType2D", "2D Drawing"))', ImageBank3DFileType: '@HttpUtility.JavaScriptStringEncode(Translate("FileType3D", "3D Drawing"))', DownloadInProgress: '@HttpUtility.JavaScriptStringEncode(Translate("DownloadInProgress", "Thank you! We are building your file, your download will begin shortly"))', ConfirmDeleteSelection: '@HttpUtility.JavaScriptStringEncode(Translate("ConfirmDeleteSelection", "Do you really want to delete all your selections ?"))' }; </script>
Terms of use

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.