public ActionResult Index() { List <string> templatesListOut = new List <string>() { "Выберите шаблон" }; string pathFolderTemplates = AppDomain.CurrentDomain.BaseDirectory + "Resources\\"; List <string> templatesList = Directory.GetFiles(pathFolderTemplates).ToList <string>(); foreach (string templates in templatesList) { templatesListOut.Add(templates.Remove(0, templates.LastIndexOf("\\") + 1)); } ViewBag.Templates = new SelectList(templatesListOut); Deleter del = new Deleter(); del.DeleteFiles(pathFolderTemplates + "Images\\"); del.DeleteFiles(pathFolderTemplates.Replace("Resources", "Documents")); ClientInfo client = new ClientInfo(); return(View(client)); }