// This is the Insert method to insert the entered Plaza item // USAGE: <asp:FormView InsertMethod="InsertItem"> public void InsertItem() { using (_db) { var item = new RHApp.Models.Plaza(); item.FechaCreacion = DateTime.Now; item.FechaModificacion = DateTime.Now; TryUpdateModel(item); if (ModelState.IsValid) { // Save changes _db.Plazas.Add(item); _db.SaveChanges(); Response.Redirect("Default"); } } }