public ActionResult Edit(int id) { Donation model = _dService.GetDonation(id, applicationID); GetDonationType(); GetContactList(); GetProjectType(model.ProjectId); GetCategory(); if (model != null) return View(model); else return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, Donation model) { try { _dService.SaveDonation(model, applicationID); return RedirectToAction("Index"); } catch { ModelState.AddRuleViolations(model.GetRuleViolations()); return View(model); } }
@model CMg.Data.Donation <fieldset> <table class="data-table"> <tr> <td> <label for="ContactID">Donner Name:</label> </td> <td> @Html.DropDownList("ContactID", (SelectList)(ViewContext.TempData["Contacts"] ?? ViewData["Contacts"])) @Html.ValidationMessage("ContactID", "Field Required") @Html.Hidden("ApplicationID",Model.ApplicationID ?? (System.Guid)Helpers.Utility.GetApplicationID) </td>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)