Do not know why MVC5 has stopped binding textbox, the value is only being shown if it was part of the request, not if I set it manually.
This prints the correct property value:
@Html.Raw(Model.MyStringField)
This prints a input box that does not have a value, i.e. value=""
@Html.TextBoxFor(m => m.MyStringField, new
{
@class = "myCssClass",
placeholder = "Test",
autocomplete = "off"
})
What could be going wrong?
MVC Hates me, these code items are on the same line but return different values:
Model.Location = "TEST";
@Html.Raw(Model.Location) // Prints TEST
@Html.TextBox(@"Location", Model.Location) // Prints value from postback