xxx

Error compiling template "Designs/Dwsimple/ItemPublisher/List/Nyhedsbreve.cshtml"
Line 230: The name 'fnName' does not exist in the current context
Line 239: The name 'UdgivDato' does not exist in the current context

1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 using System; 13 using System.Collections.Generic; 14 using System.Linq; 15 16 #line 1 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 17 using System.Text.RegularExpressions; 18 19 #line default 20 #line hidden 21 22 #line 2 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 23 using System.Web; 24 25 #line default 26 #line hidden 27 28 29 public class RazorEngine_3e05a3ef721641cba1a128cc0f257070 : Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> { 30 31 #line hidden 32 33 #line 5 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 34 35 public class WrapMethods 36 { 37 //Gets the contrasting color 38 public static string getContrastYIQ(string hexcolor) 39 { 40 if (hexcolor != "") 41 { 42 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 43 44 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 45 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 46 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 47 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 48 49 if (yiq >= 128) 50 { 51 return "black"; 52 } 53 else 54 { 55 return "white"; 56 } 57 } 58 else 59 { 60 return "black"; 61 } 62 } 63 64 65 //Truncate text 66 public static string Truncate (string value, int count, bool strip=true) 67 { 68 if (strip == true){ 69 value = StripHtmlTagByCharArray(value); 70 } 71 72 if (value.Length > count) 73 { 74 value = value.Substring(0, count + 1) + "..."; 75 } 76 77 return value; 78 } 79 80 81 //Strip text from HTML 82 public static string StripHtmlTagByCharArray(string htmlString) 83 { 84 char[] array = new char[htmlString.Length]; 85 int arrayIndex = 0; 86 bool inside = false; 87 88 for (int i = 0; i < htmlString.Length; i++) 89 { 90 char let = htmlString[i]; 91 if (let == '<') 92 { 93 inside = true; 94 continue; 95 } 96 if (let == '>') 97 { 98 inside = false; 99 continue; 100 } 101 if (!inside) 102 { 103 array[arrayIndex] = let; 104 arrayIndex++; 105 } 106 } 107 return new string(array, 0, arrayIndex); 108 } 109 110 //Make the correct count of columns 111 public static string ColumnMaker(int Col, string ScreenSize) 112 { 113 string Columns = ""; 114 115 switch (Col) 116 { 117 case 1: 118 Columns = "col-"+ScreenSize+"-12"; 119 break; 120 121 case 2: 122 Columns = "col-"+ScreenSize+"-6"; 123 break; 124 125 case 3: 126 Columns = "col-"+ScreenSize+"-4"; 127 break; 128 129 case 4: 130 Columns = "col-"+ScreenSize+"-3"; 131 break; 132 133 default: 134 Columns = "col-"+ScreenSize+"-3"; 135 break; 136 } 137 138 return Columns; 139 } 140 141 142 private string Custom(string firstoption, string secondoption) 143 { 144 if (firstoption == "custom") 145 { 146 return secondoption; 147 } 148 else 149 { 150 return firstoption; 151 } 152 } 153 } 154 155 #line default 156 #line hidden 157 158 159 #line 128 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 160 public RazorEngine.Templating.TemplateWriter GetNHBList(dynamic Loop, int Col=3) 161 { 162 #line default 163 #line hidden 164 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 165 166 #line 129 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 167 168 169 170 171 172 #line default 173 #line hidden 174 WriteLiteralTo(__razor_helper_writer, " <table"); 175 176 WriteLiteralTo(__razor_helper_writer, " class=\"table table-striped\""); 177 178 WriteLiteralTo(__razor_helper_writer, ">\r\n <thead>\r\n <td>"); 179 180 181 #line 134 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 182 WriteTo(__razor_helper_writer, Translate("Title", "Title")); 183 184 185 #line default 186 #line hidden 187 WriteLiteralTo(__razor_helper_writer, "</td>\r\n <td"); 188 189 WriteLiteralTo(__razor_helper_writer, " align=\"right\""); 190 191 WriteLiteralTo(__razor_helper_writer, ">"); 192 193 194 #line 135 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 195 WriteTo(__razor_helper_writer, Translate("Date", "Date")); 196 197 198 #line default 199 #line hidden 200 WriteLiteralTo(__razor_helper_writer, @"</td> 201 </thead> 202 203 int Count = 0; 204 205 string Columns = WrapMethods.ColumnMaker(Col, ""md""); 206 string Navn = GetString(""ItemPublisher:Item.Name""); 207 208 foreach (var nhbx in Loop){ 209 string Image = nhbx.GetString(""ItemPublisher:Item.Image""); 210 string fnName = nhbx.GetString(""ItemPublisher:Item.NHBTitle""); 211 string UdgivDato = nhbx.GetString(""ItemPublisher:Item.Udgivelsesdato""); 212 string Name = nhbx.GetString(""ItemPublisher:Item.Name""); 213 214 215 <table"); 216 217 WriteLiteralTo(__razor_helper_writer, " class=\"table table-striped\""); 218 219 WriteLiteralTo(__razor_helper_writer, ">\r\n <tbody>\r\n\r\n\r\n\t\t\t\t\t\r\n \r\n <" + 220 "a"); 221 222 WriteLiteralTo(__razor_helper_writer, " href=\'Default.aspx?Id=9162\'"); 223 224 WriteLiteralTo(__razor_helper_writer, " target=\"_blank\""); 225 226 WriteLiteralTo(__razor_helper_writer, ">"); 227 228 229 #line 156 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 230 WriteTo(__razor_helper_writer, fnName); 231 232 233 #line default 234 #line hidden 235 WriteLiteralTo(__razor_helper_writer, "</a>"); 236 237 238 #line 156 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 239 WriteTo(__razor_helper_writer, UdgivDato); 240 241 242 #line default 243 #line hidden 244 WriteLiteralTo(__razor_helper_writer, "\r\n \r\n </tbody></table>\r\n\t\t\t\t\r\n\r\n\t\r\n\t\tCount++;\r\n\r\n\t\tif " + 245 "(Count == Col)\r\n\t\t{\r\n\t\t\t<div"); 246 247 WriteLiteralTo(__razor_helper_writer, " class=\"row\""); 248 249 WriteLiteralTo(__razor_helper_writer, "><br></div>\r\n\t\t\tCount = 0;\r\n\t\t}\r\n\t}\r\n</table>\r\n"); 250 251 252 #line 171 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 253 254 255 256 #line default 257 #line hidden 258 }); 259 260 #line 172 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 261 } 262 #line default 263 #line hidden 264 265 266 public RazorEngine_3e05a3ef721641cba1a128cc0f257070() { 267 } 268 269 public override void Execute() { 270 WriteLiteral("\r\n\r\n"); 271 272 WriteLiteral("\r\n\r\n"); 273 274 WriteLiteral("\r\n\r\n\r\n\r\n\r\n<div"); 275 276 WriteLiteral(" class=\"col-md-12 col-sm-12 col-xs-12\""); 277 278 WriteLiteral(">\r\n\r\n\t<div"); 279 280 WriteLiteral(" class=\"row\""); 281 282 WriteLiteral(">&nbsp;</row>\r\n\t\t<div"); 283 284 WriteLiteral(" class=\"row\""); 285 286 WriteLiteral(">\r\n"); 287 288 WriteLiteral("\t\t\t"); 289 290 291 #line 182 "E:\dynamicweb.net\solutions\SkovboData\skovbodata.dw9.dynamicweb-cms.com\files\Templates\Designs\Dwsimple\ItemPublisher\List\Nyhedsbreve.cshtml" 292 Write(GetNHBList(GetLoop("ItemPublisher:Items.List"), 1)); 293 294 295 #line default 296 #line hidden 297 WriteLiteral(" \r\n\t\t</div>\r\n\t<div"); 298 299 WriteLiteral(" class=\"row\""); 300 301 WriteLiteral(">&nbsp;</row>\r\n</div>\t\r\n\r\n"); 302 303 } 304 } 305 } 306

1 @using System.Text.RegularExpressions 2 @using System.Web 3 4 5 @functions{ 6 public class WrapMethods 7 { 8 //Gets the contrasting color 9 public static string getContrastYIQ(string hexcolor) 10 { 11 if (hexcolor != "") 12 { 13 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 14 15 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 16 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 17 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 18 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 19 20 if (yiq >= 128) 21 { 22 return "black"; 23 } 24 else 25 { 26 return "white"; 27 } 28 } 29 else 30 { 31 return "black"; 32 } 33 } 34 35 36 //Truncate text 37 public static string Truncate (string value, int count, bool strip=true) 38 { 39 if (strip == true){ 40 value = StripHtmlTagByCharArray(value); 41 } 42 43 if (value.Length > count) 44 { 45 value = value.Substring(0, count + 1) + "..."; 46 } 47 48 return value; 49 } 50 51 52 //Strip text from HTML 53 public static string StripHtmlTagByCharArray(string htmlString) 54 { 55 char[] array = new char[htmlString.Length]; 56 int arrayIndex = 0; 57 bool inside = false; 58 59 for (int i = 0; i < htmlString.Length; i++) 60 { 61 char let = htmlString[i]; 62 if (let == '<') 63 { 64 inside = true; 65 continue; 66 } 67 if (let == '>') 68 { 69 inside = false; 70 continue; 71 } 72 if (!inside) 73 { 74 array[arrayIndex] = let; 75 arrayIndex++; 76 } 77 } 78 return new string(array, 0, arrayIndex); 79 } 80 81 //Make the correct count of columns 82 public static string ColumnMaker(int Col, string ScreenSize) 83 { 84 string Columns = ""; 85 86 switch (Col) 87 { 88 case 1: 89 Columns = "col-"+ScreenSize+"-12"; 90 break; 91 92 case 2: 93 Columns = "col-"+ScreenSize+"-6"; 94 break; 95 96 case 3: 97 Columns = "col-"+ScreenSize+"-4"; 98 break; 99 100 case 4: 101 Columns = "col-"+ScreenSize+"-3"; 102 break; 103 104 default: 105 Columns = "col-"+ScreenSize+"-3"; 106 break; 107 } 108 109 return Columns; 110 } 111 112 113 private string Custom(string firstoption, string secondoption) 114 { 115 if (firstoption == "custom") 116 { 117 return secondoption; 118 } 119 else 120 { 121 return firstoption; 122 } 123 } 124 } 125 } 126 127 128 @helper GetNHBList(dynamic Loop, int Col=3) 129 { 130 131 132 <table class="table table-striped"> 133 <thead> 134 <td>@Translate("Title", "Title")</td> 135 <td align="right">@Translate("Date", "Date")</td> 136 </thead> 137 138 int Count = 0; 139 140 string Columns = WrapMethods.ColumnMaker(Col, "md"); 141 string Navn = GetString("ItemPublisher:Item.Name"); 142 143 foreach (var nhbx in Loop){ 144 string Image = nhbx.GetString("ItemPublisher:Item.Image"); 145 string fnName = nhbx.GetString("ItemPublisher:Item.NHBTitle"); 146 string UdgivDato = nhbx.GetString("ItemPublisher:Item.Udgivelsesdato"); 147 string Name = nhbx.GetString("ItemPublisher:Item.Name"); 148 149 150 <table class="table table-striped"> 151 <tbody> 152 153 154 155 156 <a href='Default.aspx?Id=9162' target="_blank">@fnName</a>@UdgivDato 157 158 </tbody></table> 159 160 161 162 Count++; 163 164 if (Count == Col) 165 { 166 <div class="row"><br></div> 167 Count = 0; 168 } 169 } 170 </table> 171 172 } 173 174 175 176 177 178 <div class="col-md-12 col-sm-12 col-xs-12"> 179 180 <div class="row">&nbsp;</row> 181 <div class="row"> 182 @GetNHBList(GetLoop("ItemPublisher:Items.List"), 1) 183 </div> 184 <div class="row">&nbsp;</row> 185 </div> 186 187
  • Skovbo Data
  • Industrivænget 18
    4622 Havdrup

  • CVR nummer: 66 81 07 12