OK, I have a weird one here. I know that the value is passed to the property correctly, as this works fine:
@Html.TextBox("Foo", Model.Foo, new { @class = "bar" })
Now if I do this:
@Html.TextBoxFor(m => m.Foo, new { @class = "bar" })
Displays the wrong value. I do not know where this value comes from. For some pages, it shows a line version of what it should be; at other times, it shows the value of the text box next to it. I am puzzled. This is the only text block that does this. I also have a razor helper on the page that uses this exact value to display the page title, and it displays correctly.
I am not opposed to using @Html.TextBox() for this particular one, but I would like to get the bottom of this.
Has anyone had something random like this? I have quite a few controls on this particular page, and this is the only thing that happens.
source share