Show View into Another View And Insert both view At 1 click
I am trying to add one view into another view and submit both at one click .pls give me a sample code in simple without using view model because foreach create problem for list data for view model
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Shakil Ahmed51 pointsPosted Nov 27, 2017, 1:03 AM EST
// GET: itemEntries/Create public ActionResult Create() { List row = new List() { new itemEntry(){IndentName=null,Remarks=null}, new itemEntry(){IndentName=null,Remarks=null}, new itemEntry(){IndentName=null,Remarks=null} }; return View(row); } // POST: itemEntries/Createpublic ActionResult Create(List itemEntry, [Bind(Include = "IndentFormId,Sender,Receiver")] IndentFormTable indentFormTable) { if (ModelState.IsValid) { db.IndentFormTables.Add(indentFormTable); db.SaveChanges(); foreach (var i in itemEntry) { db.itemEntries.Add(i); db.SaveChanges(); } return RedirectToAction("Index"); } return View(itemEntry); } -------------------------------- view ---------------------------------Create
itemEntry