The code below run perfectly when ran on my local machine I managed to update the patient details but when i published the application to IIS server I am having the error attached. Any suggestion where I am going wrong
C#
     // Edit Patient Details
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Edit(PatientDetail patientDetail,DateTime DOB)
    {
        if (ModelState.IsValid)
        {
            var currentUser = db.vwUsers.FirstOrDefault(i => i.DomainUserName == User.Identity.Name);
            var apptime = DateTime.Now;
            //// Save today's date.             
            var age = apptime.Year - DOB.Year;
            //PatientDetail patientDetail = new PatientDetail();
            patientDetail.Age =Convert.ToString(age);
            patientDetail.LastUpdatedByUser = currentUser.FullName;
            patientDetail.LastUpdatedByUserID = currentUser.AdUserName;
            patientDetail.LastUpdatedOn = apptime;
            db.Entry(patientDetail).State = EntityState.Modified;
            db.SaveChanges();
            return RedirectToAction("Edit", new { id = patientDetail.Id, updatemessage = 1 });
        }
        return View();
    }
Chtml
      @model MPFT.SendIT.Models.NewChangeIT.PatientDetail @using 
     (Html.BeginForm()) { @Html.AntiForgeryToken()
     <div class="panel-body">
     <div class="form-horizontal">
       @Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.Id)
    <div class="form-group">
        @Html.LabelFor(model => model.Surname, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Surname, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Surname, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(model => model.Firstname, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Firstname, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Firstname, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(model => model.NHSNumber, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.NHSNumber, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.NHSNumber, "", new { @class = "text-danger" })
        </div>
    </div>
</div>
}

