Edit Navigation
We have done with Edit page. Now, we want to do instructions when user pressed the edit button.
Do as we did with Add Action.
[HttpPost]
public ActionResult Edit(Entry entry)
{
}
- Now, we want to validate the entries for Duration segment. Perform the "extract method" features in VS.
Then, we update the entry if the ModelState is in valid form.
if (ModelState.IsValid) { _entriesRepository.UpdateEntry(entry); return RedirectToAction("Index"); }
Don't forget to populate the ListItem too.
PopulateSelectList();
a