|             |Print Print
International site
Exception in template (eCom/Product/New_Product_SilhorkoExtranet_open.cshtml): System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at Silhorko.Website.CustomModules.PDFGenerator.GeneratePDFAlternative(String url, String productId, String language) in C:\Novicell Solutions\Silhorko.Website\Silhorko.Website\CustomModules\PDFGenerator.cs:line 112
   at CompiledRazorTemplates.Dynamic.edeaaebfebefaa.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()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Xml @using System.Net @using System.Web @using Silhorko.Website.CustomModules @{ var url = HttpContext.Current.Request.Url; var uri = new Uri(url.AbsoluteUri); var newQueryString = HttpUtility.ParseQueryString(uri.Query); newQueryString.Remove("printpdf"); string pagePathWithoutQueryString = uri.GetLeftPart(UriPartial.Path); string newUrl = newQueryString.Count > 0 ? String.Format("{0}?{1}", pagePathWithoutQueryString, newQueryString) : pagePathWithoutQueryString; string pdfUrl = newUrl.Contains("?") ? newUrl + "&template=printversion.html" : newUrl + "?template=printversion.html"; if (!String.IsNullOrEmpty(HttpContext.Current.Request["Culture"])) { HttpContext.Current.Session["ecomLang"] = HttpContext.Current.Request["Culture"]; } string language = HttpContext.Current.Session["ecomLang"] != null ? HttpContext.Current.Session["ecomLang"].ToString().Substring(HttpContext.Current.Session["ecomLang"].ToString().IndexOf("-") + 1).ToLower() : GetGlobalValue("Global:Area.Culture.CountryCode").ToLower(); language = language == "gb" ? "uk" : language; language = language.Replace("\"", string.Empty); if (HttpContext.Current.Request["printpdf"] != null && HttpContext.Current.Request["printpdf"] == "true") { HttpContext.Current.Response.Redirect(PDFGenerator.GeneratePDFAlternative(pdfUrl, GetString("Ecom:Product.Number"), language)); } } @functions { public string TranslateFilter(string key, string defaultValue) { string culture = HttpContext.Current.Session["ecomLang"].ToString(); string returnVal= defaultValue;    // Create a instance of XmlDocument Object if(!string.IsNullOrEmpty(key)) {    XmlDocument mydoc = new XmlDocument();    // Get the XML file path    string xmlFilePath = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Translations.xml");    // Load the XML File    mydoc.Load(xmlFilePath);        // Use the SelectNodes method to get a nodelist of the specified XPATH XmlNode node = mydoc.SelectSingleNode("descendant::key[@name='" + key + "']/translation[@culture='"+ culture +"']"); if(node != null && !string.IsNullOrEmpty(node.InnerText)) { returnVal = node.InnerText; } } return returnVal; } public string TranslatenewFilter(string key, string defaultValue) { string culture = HttpContext.Current.Session["ecomLang"].ToString(); string returnVal= ""; string[] text = key.Split(','); foreach(object obj in text){    // Create a instance of XmlDocument Object //return Translate(obj.ToString()); if(!string.IsNullOrEmpty(key)) {    XmlDocument mydoc = new XmlDocument(); // Get the XML file path string xmlFilePath = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Translations.xml"); // Load the XML File mydoc.Load(xmlFilePath); // Use the SelectNodes method to get a nodelist of the specified XPATH XmlNode node = mydoc.SelectSingleNode("descendant::key[@name='" + obj + "']/translation[@culture='"+ culture +"']"); if(node != null && !string.IsNullOrEmpty(node.InnerText)) { if(!String.IsNullOrEmpty(returnVal)) { returnVal += ", "; } returnVal += node.InnerText; } } } return returnVal; } } @{ if (!String.IsNullOrEmpty(HttpContext.Current.Request["Culture"])) { HttpContext.Current.Session["ecomLang"] = HttpContext.Current.Request["Culture"]; } else if (HttpContext.Current.Session["ecomLang"] == null) { HttpContext.Current.Session["ecomLang"] = GetGlobalValue("Global:Area.LongLang"); } <script>$.session.set('ecomLang', '@HttpContext.Current.Session["ecomLang"]');</script> } <style> .galleria { height:692px; /* defines a static gallery height */ max-width:950px; /* defines a responsive width */ } </style> @{ var list = "/Default.aspx?ID="+ @GetGlobalValue("Global:Page.ID") + "&View=ProductList_Extra_ListNy_new.cshtml"; var grid = "/Default.aspx?ID="+ @GetGlobalValue("Global:Page.ID") + "&View=ProductList_Extra_TilesNy_new.cshtml"; } <div id="container"> <div class="top-heading"><h2>@GetValue("Ecom:Product.Name")</h2></div> <div class="galleria"> @if(GetString("Ecom:Product:Field.img1.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img1.Clean")"> <img src="@GetValue("Ecom:Product:Field.img1.Clean")" data-big="@GetValue("Ecom:Product:Field.img1.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img2.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img2.Clean")"> <img src="@GetValue("Ecom:Product:Field.img2.Clean")" data-big="@GetValue("Ecom:Product:Field.img2.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img3.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img3.Clean")"> <img src="@GetValue("Ecom:Product:Field.img3.Clean")" data-big="@GetValue("Ecom:Product:Field.img3.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img4.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img4.Clean")"> <img src="@GetValue("Ecom:Product:Field.img4.Clean")" data-big="@GetValue("Ecom:Product:Field.img4.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img5.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img5.Clean")"> <img src="@GetValue("Ecom:Product:Field.img5.Clean")" data-big="@GetValue("Ecom:Product:Field.img5.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img6.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img6.Clean")"> <img src="@GetValue("Ecom:Product:Field.img6.Clean")" data-big="@GetValue("Ecom:Product:Field.img6.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img7.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img7.Clean")"> <img src="@GetValue("Ecom:Product:Field.img7.Clean")" data-big="@GetValue("Ecom:Product:Field.img7.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img8.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img8.Clean")"> <img src="@GetValue("Ecom:Product:Field.img8.Clean")" data-big="@GetValue("Ecom:Product:Field.img8.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img9.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img9.Clean")"> <img src="@GetValue("Ecom:Product:Field.img9.Clean")" data-big="@GetValue("Ecom:Product:Field.img9.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } @if(GetString("Ecom:Product:Field.img10.Clean") != ""){ <a href="@GetValue("Ecom:Product:Field.img10.Clean")"> <img src="@GetValue("Ecom:Product:Field.img10.Clean")" data-big="@GetValue("Ecom:Product:Field.img10.Clean")" data-description="Click left or right arrows to see more photos." /> </a> } </div> <div id="txt_container"> <div class="toprow"> <div class="right-col" style="position:absolute;left:13px;margin-right:5px;"> <a style="margin-top:0px;margin-right:0px;" class="nav-btn active" href="@list"><i class="btn-icon list"></i>@TranslateFilter("LIST VIEW","LIST VIEW")</a> <a style="margin-top:0px;margin-right:0px;margin-left:10px;" class="nav-btn" href="@grid"><i class="btn-icon grid"></i>@TranslateFilter("GRID VIEW","GRID VIEW")</a> @if(GetBoolean("Ecom:CatalogPublishing.UseCatalogPublishing") == true){ <a class="nav-btn btn-pos" href="/default.aspx?id=@GetValue("Ecom:Product:Page.ID")&amp;productid=@GetValue("Ecom:Product.ID")&amp;CatalogPublishingcmd=addtocatalog"><i class="btn-icon add"></i>@TranslateFilter("ADD TO LIST","ADD TO LIST")</a> <a class="nav-btn lg-btn" style="margin-top:0px;margin-bottom:0px;margin-left:10px;margin-right:0px;width:145px" href="/references_v2.aspx?CatalogPublishingcmd=preview"><i class="btn-icon list"></i>@TranslateFilter("CUSTOM REFERENCE LIST","CUSTOM REFERENCE LIST")</a> } <!--a onclick="window.open('@GetValue("Ecom:Product.Link.Clean")&Template=printversion.html','printversion','width=650,height=700,menubar=no,scrollbars=no');return false;" class="nav-btn btn-pos"><i class="btn-icon printicon"></i>PRINT</a--> <a href='@PDFGenerator.GeneratePDFAlternative(pdfUrl, GetString("Ecom:Product.Number"), language)' class="nav-btn btn-pos" style="text-transform: uppercase;"><i class="btn-icon pdficon"></i>@TranslateFilter("SAVE PDF","SAVE PDF")</a> </div> </div> <div class="toprow" style="margin-top:15px;height:60px;"> @*<p><u><i>PDF version unavailable until 19th April.</i></u></p>*@ <span><b>@TranslateFilter("Reference ID", "Reference ID"): </b> @GetString("Ecom:Product.Number")</span><br> @if(GetString("Ecom:Product:Field.Industry.Value") != ""){ <span><b>@TranslateFilter("Industry", "Industry"): </b>@TranslatenewFilter(GetString("Ecom:Product:Field.Industry.Value").Replace("_", " "), GetString("Ecom:Product:Field.Industry.Value").Replace("_", " ")) </span><br> } @if(GetString("Ecom:Product:Field.Application.Value") != ""){ <span><b>@TranslateFilter("Application","Application"): </b>@TranslatenewFilter(GetString("Ecom:Product:Field.Application.Value").Replace("_", " "), GetString("Ecom:Product:Field.Application.Value").Replace("_", " "))</span><br> } </div> <div class="maintxt"> <p>@GetValue("Ecom:Product.LongDescription")</p> @if(@GetString("Ecom:Product:Field.Technicaldata.Value.Clean") != ""){ <div style="width:49%;display:block; float:left;"> <p><b>@TranslateFilter("Technicaldata","Technical data")</b></p> @GetValue("Ecom:Product:Field.Technicaldata.Value.Clean") </div> } @if(GetString("Ecom:Product:Field.Unitsinplants.Value.Clean") != ""){ <div style="width:49%;display:block;float:left;"> <p><b>@TranslateFilter("Unitsinplant","Units in plant")</b></p> @GetValue("Ecom:Product:Field.Unitsinplants.Value.Clean") </div> } </div> </div> </div> <!--class"p_logo"--> @SnippetStart("PrintAndPDF") <style> #descrip p {margin-bottom:10px !important} </style> @foreach (LoopItem i in GetLoop("CustomFields")){ <div style="width:100%;height:10px;display:block"></div> <table style="width:100%; font-size: 8px !important;margin-top:15px !important;"> <tr> <th style="text-align:left;vertical-align: bottom;font-size:12px;"> <b>Reference @GetString("Ecom:Product.Number")</b> </th> <th align="right"><img style="width:175px;" src='@TranslateFilter("PrintAndPdfLogo", "/Files/Billeder/EUROWATER_printandpdf.png")' /></th> </tr> <tr style="height: 15px;"> <td colspan="2" style="border-bottom:1px solid #000;"></td> </tr> <tr style="margin-top:10px;height: 550px;"> <td width="50%" style="height: 550px;vertical-align:top;"><img style="width:465px;max-height:550px;margin-top:20px;float:left;" src='@i.GetString("mainImage.Clean")' /></td> <td width="50%" style="vertical-align:top; padding-left:10px;font-size:15px;text-align: left;height: 550px;"> <h3 style="line-height:100%;">@GetValue("Ecom:Product.Name")</h3> <table style="width:100%"> <tr> <td width="80px"><b>@TranslateFilter("Industry", "Industry")</b></td> <td>@TranslatenewFilter(i.GetString("Industry.Value").Replace("_", " "), i.GetString("Industry.Value").Replace("_", " ")) </td> </tr> <tr> <td width="80px"><b>@TranslateFilter("Application", "Application")</b></td> <td>@TranslatenewFilter(i.GetString("Application").Replace("_", " "), i.GetString("Application").Replace("_", " "))</td> </tr> @if (i.GetString("salesOffice.Value") != "") { <tr> <td width="80px"><b>@TranslateFilter("Country", "Country")</b></td> <td>@TranslatenewFilter(i.GetString("country.Value").Replace("_", " ").Replace(",", ", "), i.GetString("country.Value").Replace("_", " ").Replace(",", ", "))</td> </tr> } <tr> <td colspan="2" id="descrip" style="padding-top:10px;"> @if (GetString("Ecom:Product.LongDescription") != "") { <p><b>@TranslateFilter("Description", "Description")</b></p> @GetValue("Ecom:Product.LongDescription") } </td> </tr> </table> <table width="48%" style="float:left;"> <tr> <td style="padding-top:10px;"><b>@TranslateFilter("Technicaldata", "Technical data")</b></td> </tr> <tr> <td>@i.GetValue("Technicaldata.Value.Clean")</td> </tr> </table> <table width="48%" style="float:left;margin-left:15px;"> <tr><td style="padding-top:10px;"><b>@TranslateFilter("Unitsinplant", "Units in plant")</b><td></tr> <tr><td>@i.GetValue("Unitsinplants.Value.Clean")</td></tr> </table> <table style="width: 100%;"> <tr> <td colspan="2"> @TranslateFilter("PDFInterestedInMorePictures", "Interested in more pictures or related references, please visit") <a href="@TranslateFilter("PDFReferenceLink", "http://www.eurowater.com/references")">@TranslateFilter("PDFReferenceLinkText", "eurowater.com/references")</a> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" align="center"><img style="width:175px; margin-top: 20px;" src="/Files/Billeder/buttons/Ourworldiswater.png" /></td> </tr> </table> } @SnippetEnd("PrintAndPDF") <!--gallery launch--> <!--needs to be moved--> <script> $(document).ready(function(){ // Load the Twelve theme Galleria.loadTheme("/Files/System/files/themes/twelve/galleria.twelve.min.js"); Galleria.configure({ imageCrop: 'landscape' }); // Initialize Galleria Galleria.run('.galleria'); }); </script> <!--gallery launch end-->