private List <string> GetMenuTemplates(string basetempl, string controlPath, string theme, string lang) { var templ = ""; var rtnL = new List <string>(); rtnL.Add(basetempl); var lp = 1; templ = NBrightBuyUtils.GetRazorTemplateData(basetempl.Replace(".cshtml", lp.ToString("") + ".cshtml"), controlPath, theme, lang); while (!String.IsNullOrEmpty(templ)) { rtnL.Add(basetempl.Replace(".cshtml", lp.ToString("") + ".cshtml")); lp += 1; templ = NBrightBuyUtils.GetRazorTemplateData(basetempl.Replace(".cshtml", lp.ToString("") + ".cshtml"), controlPath, theme, lang); if (lp > 99) { templ += "POSSIBLE INFINATE LOOP: CatMenuRazorBuilder.cs, GenMenuTemplate"; rtnL.Add(templ); break; } } return(rtnL); }