Saving Dynamic Form Fields to Database with Fixed Values in MVC

kadir 60 Reputation points


    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;




            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
A set of technologies in the .NET Framework for building web applications and XML web services.
3,371 questions
{count} votes