asp.net mvc formcollection
- by mazhar
public ActionResult Edit(int id, FormCollection formValues) {
07.
08. // Retrieve existing dinner
09. Dinner dinner = dinnerRepository.GetDinner(id);
10.
11. // Update dinner with form posted values
12. dinner.Title = Request.Form["Title"];
13. dinner.Description = Request.Form["Description"];
14. dinner.EventDate = DateTime.Parse(Request.Form["EventDate"]);
15. dinner.Address = Request.Form["Address"];
16. dinner.Country = Request.Form["Country"];
17. dinner.ContactPhone = Request.Form["ContactPhone"];
18.
19. // Persist changes back to database
20. dinnerRepository.Save();
21.
22. // Perform HTTP redirect to details page for the saved Dinner
23. return RedirectToAction("Details", new { id = dinner.DinnerID });
24.}
formValues is not used in any form, what is the used of it.