public IActionResult Create(Asset asset) { try { AssetsManager.Add(asset); // call the method to add the info to the database return(RedirectToAction("Index")); } catch { return(View()); } }
//[ValidateAntiForgeryToken] public IActionResult Create(Asset asset) { try { AssetsManager.Add(asset); return(RedirectToAction("Index", "Home")); } catch { return(View()); } }
public IActionResult Create(Asset asset) { // if new asset is successfully added to db, redirect to main page. if not, reload current view try { AssetsManager.Add(asset); return(RedirectToAction("Search")); } catch { return(View()); } }