public ActionResult Delete(String playerID, String achievementName, FormCollection collection) { try { _repository.DeletePlayerAchievement(playerID, achievementName); return(RedirectToAction("Index")); } catch (Exception ex) { //error msg for failed delete in XML file ViewBag.ErrorMsg = "Error deleting record. " + ex.Message; return(View(_repository.GetPlayerAchievementByAchievementName(playerID, achievementName))); } }
public ActionResult DeleteConfirmed(string playerID, string achievementName) { _repository.DeletePlayerAchievement(playerID, achievementName); return(RedirectToAction("Index", "PlayerAchievements", new { id = playerID })); }