If I put a disabled='disabled'
propertie in a TextBox with Razor, when I submit my form, the value of this TextBox isn't sent to the controller.
@using (Html.BeginForm("Principal", "Home")) {
<div class="form-group">
@Html.LabelFor(m => m.Fornecedor, new { @class = "col-sm-2 control-label" })
<div class="col-sm-9">
@Html.TextBox("Fornecedor", Model.Fornecedor, new { @class = "form-control", type = "text", disabled = "disabled" })
</div>
</div>
}
When submitted, the Model.Fornecedor value in controller is null, but without the disabled
propertie, the value return correctlly.
Can someone help me, to put a TextBox field disabled but pass his default value to controller when the form is submitted ?