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 2 values
Then on your view
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With