repopulation

ASP.NET MVC Form repopulation

I have a controller with two actions: [AcceptVerbs("GET")] public ActionResult Add() { PrepareViewDataForAddAction(); return View(); } [AcceptVerbs("POST")] public ActionResult Add([GigBinderAttribute]Gig gig, FormCollection formCollection) { if (ViewData.ModelState.IsValid) { ...

How do I populate these fields from existing data?

I'm not sure how to make a few parts of my form to populate from data from an array I'm passing from the database. First is this <select> object. The key estimate_lead_id in the database holds the value, and I want the dropdown to auto-select based on the value from the database. <select name="estimate_lead_id"> <? foreach($leads->...

How do I make these fields autopopulate from the database?

I have an array, which holds values like this: $items_pool = Array ( [0] => Array ( [id] => 1 [quantity] => 1 ) [1] => Array ( [id] => 2 [quantity] => 1 ) [2] => Array ( [id] => 72 [quantity] => 6 ) [3] => Array ( [id] => 4 [quantity] => 1 ) [4] => Array ( [id] => 5 [quantity] => 1 ) [5] => Array ( [id] => 7 [quantity] => 1 ) [6] ...