Ok, I've got a weird one here. I know the value is being 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" })
It show's an incorrect value. I have absolutely no idea where this value is coming from. For some pages, it shows a lowercase version of what it should be, other times, it shows the value of the textbox next to it. I'm baffled. It's the only textbox that does this. I also have a razor helper on the page that uses this exact value to display the heading of the page, and that shows correctly.
I don't mind using @Html.TextBox()
for this particular one, but I'd like to get the bottom of this.
Anyone else had anything random like this happen? I have quite a few controls on this particular page and it's the only one this happens to.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…