Error compiling template "Designs/Ashton/_parsed/home fullwidth.parsed.cshtml"
Line 27: 'CompiledRazorTemplates.Dynamic.abebcedcabfc.WrapMethods.getContrastYIQ(string)': not all code paths return a value
Line 72: Assignment made to same variable; did you mean to assign something else?

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 3 @using System 4 @using System.Web 5 @using System.Globalization; 6 7 @using System.Text.RegularExpressions 8 @using System.Web 9 10 11 @functions{ 12 public class WrapMethods 13 { 14 //Gets the contrasting color 15 public static string getContrastYIQ(string hexcolor) 16 { 17 if (hexcolor != "") 18 { 19 try 20 { 21 hexcolor = Regex.Replace(hexcolor, "[^0-9a-zA-Z]+", ""); 22 23 int r = Convert.ToByte(hexcolor.Substring(0, 2), 16); 24 int g = Convert.ToByte(hexcolor.Substring(2, 2), 16); 25 int b = Convert.ToByte(hexcolor.Substring(4, 2), 16); 26 int yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000; 27 28 if (yiq >= 128) 29 { 30 return "black"; 31 } 32 else 33 { 34 return "white"; 35 } 36 } catch 37 { 38 39 } 40 41 } 42 else 43 { 44 return "black"; 45 } 46 } 47 48 49 //Truncate text 50 public static string Truncate (string value, int count, bool strip=true) 51 { 52 if (strip == true){ 53 value = StripHtmlTagByCharArray(value); 54 } 55 56 if (value.Length > count) 57 { 58 value = value.Substring(0, count - 1) + "..."; 59 }else{ 60 value = value; 61 } 62 63 return value; 64 } 65 66 67 //Strip text from HTML 68 public static string StripHtmlTagByCharArray(string htmlString) 69 { 70 char[] array = new char[htmlString.Length]; 71 int arrayIndex = 0; 72 bool inside = false; 73 74 for (int i = 0; i < htmlString.Length; i++) 75 { 76 char let = htmlString[i]; 77 if (let == '<') 78 { 79 inside = true; 80 continue; 81 } 82 if (let == '>') 83 { 84 inside = false; 85 continue; 86 } 87 if (!inside) 88 { 89 array[arrayIndex] = let; 90 arrayIndex++; 91 } 92 } 93 return new string(array, 0, arrayIndex); 94 } 95 96 //Make the correct count of columns 97 public static string ColumnMaker(int Col, string ScreenSize) 98 { 99 string Columns = ""; 100 101 switch (Col) 102 { 103 case 1: 104 Columns = "col-"+ScreenSize+"-12"; 105 break; 106 107 case 2: 108 Columns = "col-"+ScreenSize+"-6"; 109 break; 110 111 case 3: 112 Columns = "col-"+ScreenSize+"-4"; 113 break; 114 115 case 4: 116 Columns = "col-"+ScreenSize+"-3"; 117 break; 118 119 case 6: 120 Columns = "col-"+ScreenSize+"-2"; 121 break; 122 123 default: 124 Columns = "col-"+ScreenSize+"-3"; 125 break; 126 } 127 128 return Columns; 129 } 130 131 132 private string Custom(string firstoption, string secondoption) 133 { 134 if (firstoption == "custom") 135 { 136 return secondoption; 137 } 138 else 139 { 140 return firstoption; 141 } 142 } 143 } 144 } 145 146 @{ 147 var logoLink = GetString("Item.Area.Logo_Image"); 148 var facebookLink = GetString("Item.Area.Facebook_Link"); 149 var twitterLink = GetString("Item.Area.Twitter_Link"); 150 var youtubeLink = GetString("Item.Area.YouTube_Link"); 151 var instagramLink = GetString("Item.Area.Instagram_Link"); 152 var firstPageId = GetString("DwAreaFirstPageID"); 153 var areaId = GetInteger("DwAreaID"); 154 var searchPageId = areaId == 22 ? 11787 : 11727; 155 var DwCurrentTopPageID = GetString("DwTopPageID"); 156 } 157 158 159 <!doctype html> 160 <html class="no-js" lang=""> 161 <head> 162 <meta charset="utf-8"> 163 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 164 <title>@GetValue("Title")</title> 165 @GetValue("MetaTags") 166 @GetValue("CopyRightNotice") 167 168 <link rel="icon" href='@GetString("Item.Area.Favicon")'> 169 170 <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no"> 171 <link rel="shortcut icon" type="image/png" href=""> 172 <link href="https://fonts.googleapis.com/css?family=Oswald|Roboto+Condensed:400,700|Roboto:300,400,700" rel="stylesheet"> 173 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> 174 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 175 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 176 <link rel="stylesheet" href="/Files/Templates/Designs/Ashton/css/jquery.bxslider.css"> 177 <link rel="stylesheet" href="/Files/Templates/Designs/Ashton/css/main.css"> 178 <link rel="stylesheet" href="/Files/Templates/Designs/Ashton/css/secondary%20main.css"> 179 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Ashton/assets/css/slick/slick.css"> 180 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Ashton/assets/css/slick/slick-theme.css"> 181 <!-- Essentials --> 182 <script src="/Files/Templates/Designs/Ashton/assets/js/jquery.min.js"></script> 183 <script src="/Files/Templates/Designs/Ashton/assets/js/jquery.js"></script> 184 <script src="/Files/Templates/Designs/Ashton/assets/js/bootstrap.min.js"></script> 185 <script src="/Files/Templates/Designs/Ashton/assets/js/bootstrap-hover-dropdown.min.js"></script> 186 187 <script src="/Files/Templates/Designs/Ashton/assets/js/modernizr.min.js"></script> 188 189 <script src="/Files/Templates/Designs/Ashton/assets/js/jquery.mousewheel.min.js"></script> 190 <script src="/Files/Templates/Designs/Ashton/assets/js/jquery.easing.1.3.js"></script> 191 192 <!-- Assets --> 193 194 <script src="/Files/Templates/Designs/Ashton/assets/js/jquery.fancybox.min.js"></script> 195 <script src="/Files/Templates/Designs/Ashton/assets/js/spin.min.js"></script> 196 197 <!-- Sripts for individual pages, depending on what plug-ins are used --> 198 <script type="text/javascript" src="/Files/Templates/Designs/Ashton/assets/js/jasny-bootstrap.min.js"></script> 199 200 <!-- Replacing the Home text --> 201 <script> 202 203 </script> 204 205 <!-- Initialize Fancybox --> 206 207 <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> 208 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.js"></script> 209 <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>--> 210 <script> 211 var DwCurrentTopPageID = '@GetString("DwTopPageID")'; 212 </script> 213 @GetValue("Stylesheets") 214 @GetValue("Javascripts") 215 </head> 216 <body> 217 @if (!string.IsNullOrWhiteSpace(GetString("Item.Area.Favicon"))) { 218 string favicon = GetString("Item.Area.Favicon"); 219 <link href="@favicon" rel="icon" type="image/png"> 220 } 221 <div class="wrapper"> 222 <!-- Header Starts --> 223 <header> 224 <div class="container"> 225 <ul class="list-inline text-right socials"> 226 @if (!string.IsNullOrWhiteSpace(facebookLink)) { 227 <li> 228 <a href="@facebookLink"><i class="fa fa-facebook"></i></a> 229 </li> 230 } 231 @if (!string.IsNullOrWhiteSpace(twitterLink)) 232 { 233 <li> 234 <a href="@twitterLink"><i class="fa fa-twitter"></i></a> 235 </li> 236 } 237 @if (!string.IsNullOrWhiteSpace(instagramLink)) 238 { 239 <li> 240 <a href="@instagramLink"><i class="fa fa-instagram"></i></a> 241 </li> 242 } 243 @if (!string.IsNullOrWhiteSpace(youtubeLink)) 244 { 245 <li> 246 <a href="@youtubeLink"><i class="fa fa-youtube"></i></a> 247 </li> 248 } 249 </ul> 250 </div> 251 <nav class="navbar navbar-default"> 252 <div class="container"> 253 <!-- Brand and toggle get grouped for better mobile display --> 254 <div class="navbar-header"> 255 @if (!string.IsNullOrWhiteSpace(logoLink)) 256 { 257 <a class="navbar-brand" href="default.aspx?id=@firstPageId"> 258 <img src="@logoLink" alt="Logo" class="img-responsive"> 259 </a> 260 } 261 <button aria-expanded="false" class="navbar-toggle collapsed" data-target="#header-menu" data-toggle="collapse" type="button"> 262 <span class="sr-only">Toggle navigation</span> 263 <span class="icon-bar"></span> 264 <span class="icon-bar"></span> 265 <span class="icon-bar"></span> 266 </button> 267 </div><!-- Collect the nav links, forms, and other content for toggling --> 268 <div class="collapse navbar-collapse" id="header-menu"> 269 <form class="navbar-form navbar-right" id="searchForm" method="post" action="" onsubmit="testing()"> 270 <div class="form-group"> 271 <input type="text" id="searchVal" name="q" autocomplete="off" class="form-control" placeholder="Search"> 272 <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> 273 </div> 274 </form> 275 @GetValue("DwNavigation(mainNav)") 276 </div><!-- /.navbar-collapse --> 277 </div><!-- /.container-fluid --> 278 </nav> 279 </header> 280 <!-- Header Ends --> 281 <!-- Section Starts --> 282 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 283 284 285 @GetValue("Title(Full width page)") 286 @GetValue("Description(Use this page for full width pages with no left navigation.)") 287 288 @{ 289 string siteurl = GetGlobalValue("Global:Request.Url").ToString(); 290 } 291 292 <section class="section banner"> 293 <div class="container"> 294 <div class="banner-content" id="bannerContent">@GetValue("DwContent(bannerContent)")</div> 295 </div> 296 </section> 297 298 299 <section class="section"> 300 <div class="container" style="padding:0 30px 0 30px;"> 301 <div class="row" id="middleContent">@GetValue("DwContent(middleContent)")</div> 302 </div> 303 </section> 304 305 306 <!-- Section Ends --> 307 <!-- Footer Starts --> 308 <footer> 309 310 <div class="footer-copyright"> 311 <div class="container"> 312 <div class="row"> 313 <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> 314 <div class="col"> 315 <p>Copyright &copy @GetGlobalValue("Global:Server.Date.Year") @GetValue("Item.Area.FooterCompanyName")</p> 316 </div> 317 </div> 318 <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 text-right"> 319 @GetValue("DwNavigation(footermenu)") 320 321 </div> 322 </div> 323 </div> 324 </div> 325 <div class="container"> 326 <a href="javascript:void(0)" id="viewsitemap" class="text-uppercase" onclick="SitemapColl_Expen(this)"> 327 Sitemap <i class="fa fa-chevron-up"></i> 328 </a> 329 </div> 330 331 332 <div id="sitemap" style="background-color:#0a0a0a"> 333 <div class="container"> 334 @if (GetBoolean("Item.Area.FooterShowSitemap")) 335 {} 336 <div class="col-md-12 col-sm-12 col-xs-12"> 337 <div class="col"> 338 @GetValue("DwNavigation(footersitemap)") 339 </div> 340 <div>&nbsp;</div> 341 </div> 342 343 </div> 344 </div> 345 346 347 </footer> 348 349 <!-- Footer Ends --> 350 351 352 353 354 <script type="text/javascript" src="/Files/Templates/Designs/Ashton/assets/js/jquery.bxslider.js"></script> 355 <script type="text/javascript" src="/Files/Templates/Designs/Ashton/assets/js/main.js"></script> 356 </div> 357 </body> 358 </html> 359 360 <script> 361 var act = 0; 362 function setCookie(key, value) { 363 var expires = new Date(); 364 expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000)); 365 document.cookie = key + '=' + value + ';expires=' + expires.toUTCString(); 366 } 367 368 function getCookie(key) { 369 var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)'); 370 return keyValue ? keyValue[2] : null; 371 } 372 function SitemapColl_Expen(_element){ 373 if($(".dwnavigation").css("display") == "none"){ 374 375 $(this).children().removeClass("fa fa-angle-down"); 376 $(this).children().addClass("fa fa-angle-up"); 377 $(".dwnavigation").slideDown(); 378 }else{ 379 $(this).children().removeClass("fa fa-angle-up"); 380 $(this).children().addClass("fa fa-angle-down"); 381 $(".dwnavigation").slideUp(); 382 } 383 } 384 function coll_Expen(_element){ 385 $(".faq-content").each(function(){ 386 var id = $(this).attr("id"); 387 var ex_id = $(_element).next().attr("id"); 388 if(id == ex_id){ 389 if($(this).css("display") == "none"){ 390 $(this).parent().children().first().children().children().children().removeClass("fa fa-angle-down"); 391 $(this).parent().children().first().children().children().children().addClass("fa fa-angle-up"); 392 $(this).slideDown(); 393 }else{ 394 $(this).parent().children().first().children().children().children().removeClass("fa fa-angle-up"); 395 $(this).parent().children().first().children().children().children().addClass("fa fa-angle-down"); 396 $(this).slideUp(); 397 } 398 }else{ 399 var className = $(this).parent().children().first().children().children().children().attr("class"); 400 if(className == "fa fa-angle-up"){ 401 $(this).parent().children().first().children().children().children().removeClass("fa fa-angle-up"); 402 $(this).parent().children().first().children().children().children().addClass("fa fa-angle-down"); 403 } 404 405 } 406 407 }); 408 409 } 410 411 $(document).ready(function(){ 412 $("#sitemap").hide(); 413 $("#viewsitemap").click(function(){ 414 $("#sitemap").slideToggle(); 415 $(this).addClass("expanded"); 416 $("html, body").animate({ scrollTop: $(document).height() }, 1000); 417 418 419 }); 420 421 $('#menuOn').click(function(){//for mobile menu close 422 $('#menuOn > .fa-bars').toggleClass('hide'); 423 $('#menuOn > .fa-times').toggleClass('hide'); 424 }); 425 426 //footer min-height 427 var innerheight=$(window).innerHeight(); 428 $(".fullwidth_wrapper").attr('style','min-height:'+(innerheight-223)+'px'); 429 430 $("#myNavmenu .panel-group").attr('style','height:'+(innerheight-58)+'px;background:#252525'); 431 432 /*document.getElementById("testslick").removeAttribute("style"); 433 $('.testslick').slick({ 434 435 }); */ 436 }); 437 438 439 function testing() 440 { 441 document.getElementById("searchForm").action="/default.aspx/?id="+@searchPageId + "&q=" + $("#searchVal").val(); 442 } 443 </script> 444 <style> 445 .footer .col p { 446 padding: 5px 0 10px 0; 447 text-transform: uppercase; 448 font-size: 12px; 449 } 450 451 452 453 </style>