asp.net mvc formcollection

Posted by mazhar on Stack Overflow See other posts from Stack Overflow or by mazhar
Published on 2010-05-13T08:32:45Z Indexed on 2010/05/13 8:34 UTC
Read the original article Hit count: 466

Filed under:
|
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.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc