public ActionResult SearchAdminCreateIndex() { try { AzureSearch.CreateSearchIndex(); TempData["Success"] = "Search index created."; } catch (Exception ex) { TempData["Error"] = ex.ToString().SubStringPlus(0, 100); } return(RedirectToAction("SearchAdmin", "Admin")); }
public ActionResult SearchAdminCreateIndex() { string err = ""; try { AzureSearch.CreateSearchIndex(); TempData["Success"] = "Search index created."; } catch (Exception ex) { err = ex.ToString(); } TempData["Error"] = err; return(RedirectToAction("SearchAdmin", "Admin")); }