Monday - Friday - View Hours
Error executing template "Designs/DASPublic/ItemPublisher/Details/eventDetail.cshtml" System.Web.HttpException (0x80070002): Directory 'F:\Domains\Sites\uat-das.mydwsite.com\Files\Files\DAS\Logos\Tradeshows' does not exist. Failed to start monitoring file changes. at System.Web.FileChangesMonitor.FindDirectoryMonitor(String dir, Boolean addIfNotFound, Boolean throwOnError) at System.Web.FileChangesMonitor.StartMonitoringPath(String alias, FileChangeEventHandler callback, FileAttributesData& fad) at System.Web.Caching.CacheDependency.Init(Boolean isPublic, String[] filenamesArg, String[] cachekeysArg, CacheDependency dependency, DateTime utcStart) at System.Web.Caching.CacheDependency..ctor(String filename, DateTime start) at Dna.ImageProcessing.FingerPrinter.Tag(String rootRelativePath) at Dna.ImageProcessing.ImageProcessorSettings.ToUrl(Boolean skipConvertingToParameterlessUrl) at CompiledRazorTemplates.Dynamic.RazorEngine_52a34eaf8cee4ec9afb7d91cf02408ea.GetImage(ImageProcessorSettings settings) in F:\Domains\Sites\uat-das.mydwsite.com\Files\Templates\Designs\DASPublic\ItemPublisher\Details\eventDetail.cshtml:line 73 at CompiledRazorTemplates.Dynamic.RazorEngine_52a34eaf8cee4ec9afb7d91cf02408ea.GetImage(String url, Int32 width, Int32 height, Int32 widthTablet, Int32 heightTablet, Int32 widthMobile, Int32 heightMobile, ImageProcessorSettings settings) in F:\Domains\Sites\uat-das.mydwsite.com\Files\Templates\Designs\DASPublic\ItemPublisher\Details\eventDetail.cshtml:line 145 at CompiledRazorTemplates.Dynamic.RazorEngine_52a34eaf8cee4ec9afb7d91cf02408ea.Execute() in F:\Domains\Sites\uat-das.mydwsite.com\Files\Templates\Designs\DASPublic\ItemPublisher\Details\eventDetail.cshtml:line 22 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.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()
1 @inherits RazorTemplateBase<RazorTemplateModel<Template>> 2 @using Dynamicweb.Rendering; 3 @using System.Collections.Specialized; 4 5 @{ 6 7 string str_title = GetString("ItemPublisher:Item.Title.Value"); 8 string str_imagePath = GetString("ItemPublisher:Item.Image.Value"); 9 string str_location = GetString("ItemPublisher:Item.Location.Value"); 10 DateTime dat_date = GetDate("ItemPublisher:Item.Date.Value"); 11 string str_date = dateFormatWithSuffix(dat_date); 12 string str_teaser = GetString("ItemPublisher:Item.Teaser.Value"); 13 string str_description = GetString("ItemPublisher:Item.Description.Value"); 14 string str_link = GetString("ItemPublisher:Item.Link.Value"); 15 string classImage = !string.IsNullOrWhiteSpace(str_imagePath) ? "col-md-9" : "noPadding"; 16 string str_back = System.Web.HttpContext.Current.Request.UrlReferrer != null ? System.Web.HttpContext.Current.Request.UrlReferrer.AbsolutePath : ""; 17 18 <article class="col-xs-12"> 19 <div class="container-fluid"> 20 <div class="row"> 21 @if(!string.IsNullOrWhiteSpace(str_imagePath)) 22 { 23 <div class="col-xs-12 col-md-3 noPadding"> 24 <figure> 25 <img src='@GetImage(str_imagePath,195,0,0,0,0,0)' /> 26 </figure> 27 </div> 28 } 29 <div class="col-xs-12 @classImage pressDetails"> 30 <h3>@str_title</h3> 31 @* 32 <span>@str_location - @str_date</span> 33 34 <p> 35 @str_teaser 36 </p> 37 *@ 38 <p> 39 @str_description 40 </p> 41 <a class="readMore" href="@str_back">Back</a> 42 </div> 43 </div> 44 </div> 45 </article> 46 47 } 48 49 @functions{ 50 string dateFormatWithSuffix(DateTime date) 51 { 52 string str_dateFormat = "MMM dd, yyyy"; 53 string str_formatedDate= date.ToString(str_dateFormat); 54 return str_formatedDate; 55 } 56 } 57 58 59 @using Dna.ImageProcessing; 60 @using Dynamicweb.Frontend.Devices; 61 62 @{ 63 string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); 64 } 65 66 @functions{ 67 /// <summary> 68 /// Returns the URL for the given ImageSettings. 69 /// </summary> 70 /// <param name="settings">The ImageSettings used to generate the URL.</param> 71 private static string GetImage(ImageProcessorSettings settings) 72 { 73 return settings.ToUrl(); 74 } 75 76 /// <summary> 77 /// Returns the URL for the given ImageSettings. 78 /// </summary> 79 /// <param name="url">The URL to the image.</param> 80 /// <param name="settings">The ImageSettings used to generate the URL.</param> 81 public static string GetImage(string url, ImageProcessorSettings settings = null) 82 { 83 if (settings == null) 84 { 85 settings = new ImageProcessorSettings(); 86 } 87 settings.ImageUrl = url; 88 return GetImage(settings); 89 } 90 91 /// <summary> 92 /// Returns the URL for the given ImageSettings. 93 /// </summary> 94 /// <param name="url">The URL to the image.</param> 95 /// <param name="width">The requested width of the image.</param> 96 /// <param name="height">The requested height of the image.</param> 97 /// <param name="settings">The ImageSettings used to generate the URL.</param> 98 public static string GetImage(string url, int width, int height, ImageProcessorSettings settings = null) 99 { 100 if (settings == null) 101 { 102 settings = new ImageProcessorSettings(); 103 } 104 settings.Width = width; 105 settings.Height = height; 106 settings.BackgroundColor = "ffffff"; 107 return GetImage(url, settings); 108 } 109 110 /// <summary> 111 /// Returns the URL for the given ImageSettings. 112 /// </summary> 113 /// <param name="url">The URL to the image.</param> 114 /// <param name="width">The requested width of the image.</param> 115 /// <param name="height">The requested height of the image.</param> 116 /// <param name="widthTablet">The requested width of the image for a tablet device.</param> 117 /// <param name="heightTablet">The requested height of the image for a tablet device.</param> 118 /// <param name="widthMobile">The requested width of the image for a mobile device.</param> 119 /// <param name="heightMobile">The requested height of the image for a mobile device.</param> 120 /// <param name="settings">The ImageSettings used to generate the URL.</param> 121 public static string GetImage(string url, int width, int height, int widthTablet, int heightTablet, int widthMobile, int heightMobile, ImageProcessorSettings settings = null) 122 { 123 var currentDevice = Dynamicweb.Frontend.PageView.Current().Device; 124 125 switch (currentDevice) 126 { 127 case DeviceType.Tablet: 128 width = widthTablet != 0 ? widthTablet : width; 129 height = heightTablet != 0 ? heightTablet : height; 130 break; 131 case DeviceType.Mobile: 132 width = widthMobile != 0 ? widthMobile : width; 133 height = heightMobile != 0 ? heightMobile : height; 134 break; 135 // default: Skip; just use existing width and height 136 } 137 if (settings == null) 138 { 139 settings = new ImageProcessorSettings(); 140 } 141 settings.ImageUrl = url; 142 settings.Width = width; 143 settings.Height = height; 144 settings.BackgroundColor = "ffffff"; 145 return GetImage(settings); 146 } 147 }