I have the following bit in my view :
@Html.TextBoxFor(model => model.PersonnelId, new { disabled = "disabled" })
In my controller I have this :
if (ModelState.IsValid)
{
PersonnelFacade.SavePerson(person);
return RedirectToAction("Index");
}
Now when I check the person.PersonnelId it is empty.
When I remove the {disabled = “disabled” } it works fine but then I can change the PersonnelId which is not what I want to do.
What am I doing wrong?
Try making it readonly instead.