ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(EgitimSeminerViewModel model)
{
if (ModelState.IsValid)
{
for (int i = 0; i < model.EgitimSeminerBilgiList.Count; i++)
{
TBL_EgitimSeminerBilgi item = new TBL_EgitimSeminerBilgi();
item.EgitimKonu = model.EgitimSeminerBilgiList[i].EgitimKonu;
item.EgitimKurum = model.EgitimSeminerBilgiList[i].EgitimKurum;
item.EgitimSuresi = model.EgitimSeminerBilgiList[i].EgitimSuresi;
db.TBL_EgitimSeminerBilgi.Add(item);
}
db.SaveChanges();
return RedirectToAction("Create"); // Or other redirection
}
return View(model);
}
Hello everyone, friends, my goal here is to record according to the number of incoming data, no problem until this part
but I also want to add the GeneralInfoid and value fields in the same table, so these fields will be fixed.
item.GenelBilgiid = 12; item.deger = false; no matter how many times the data is added