mardi 14 mars 2017

How can I save a List in ASP.NET

I would like to know how can I save a List (many column) instead of one column in ASP.NET, THANKS!!

    public ActionResult Audit(int? id)
        var tQ = from t in db.TR.Include("SInfo")
                        where t.SId == id 
                        orderby t.SId, t.Tid
                        select t;

        var list = tQ.ToList();
        return View(list);

    public ActionResult Audit(TrainingRecord list)
        if (ModelState.IsValid)
            db.Entry(list).State = System.Data.Entity.EntityState.Modified;
            return RedirectToAction("Audit");
        return View(list);

I cannot save by this two contollers, is something missing or wrong in the controller or view?

Aucun commentaire:

Enregistrer un commentaire