It's my first question! In my project when I'm input date in special page, it is saved to database, but when I edit this information in other page it is not display, and i should input information about date again....
It is view for create and edit information:
<div class="editor-label"> @Html.LabelFor(model => model.DatePol) </div> <div class="editor-field"> @Html.EditorFor(model => model.DatePol) @Html.ValidationMessageFor(model => model.DatePol) </div> Controller (part of edit): // // GET: /Uchet/Edit/5 public ActionResult Edit(string userName, string nameTitle, int id = 0) { var NameLst = new List<string>(); var NameQry = from b in db.Users orderby b.Name select b.Name; NameLst.AddRange(NameQry.Distinct()); ViewBag.userName = new SelectList(NameLst); var TitleLst = new List<string>(); var TitleQry = from r in db.Lib orderby r.Title select r.Title; TitleLst.AddRange(TitleQry.Distinct()); ViewBag.nameTitle = new SelectList(TitleLst); Uchet uchet = db.Uchets.Find(id); if (uchet == null) { return HttpNotFound(); } return View(uchet); } // // POST: /Uchet/Edit/5 [HttpPost] public ActionResult Edit(Uchet uchet) { if (ModelState.IsValid) { db.Entry(uchet).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(uchet); }