public virtual ActionResult Index() { // If we are the RC site, then our RC URL is null. This turns off all RC handling in the view. var isRc = UrlRcBase != null && HttpContext.Request.Url.AbsoluteUri.TrimEnd('/').StartsWith(UrlRcBase, StringComparison.InvariantCultureIgnoreCase); if (isRc) { HttpContext.Trace.Write("RC", string.Format("This is an RC site. All RC links will be invisible", isRc)); } else { HttpContext.Trace.Write("RC", string.Format("This is a production site. RC links will be invisible", isRc)); } var model = new LauncherViewModel { UrlRcBase = UrlRcBase, //Categories = query.Where(p => p.MenuItems.Count > 0).ToArray(), Categories = CreateMenuCategories().ToList(), IsRcSite = !isRc }; return(View(this.Views.ViewNames.Index, model)); }
/// <summary> /// It is important to order the menu choices, otherwise they can display in different order each time; /// This is the action for the home page and is the default route /// </summary> /// <returns></returns> public virtual ActionResult Index() { // If we are the RC site, then our RC URL is null. This turns off all RC handling in the view. var isRc = HttpContext.Request.Url.AbsoluteUri.TrimEnd('/').StartsWith(UrlRcBase, StringComparison.InvariantCultureIgnoreCase); if (isRc) { HttpContext.Trace.Write("RC", string.Format("This is an RC site. All RC links will be invisible", isRc)); } else { HttpContext.Trace.Write("RC", string.Format("This is a production site. RC links will be invisible", isRc)); } var model = new LauncherViewModel { UrlRcBase = UrlRcBase, //Categories = query.Where(p => p.MenuItems.Count > 0).ToArray(), Categories = CreateMenuCategories().ToList(), IsRcSite = !isRc }; return View(this.Views.ViewNames.Index, model); }