If you provide it as @value
, it will be overridden by the models value.
If you provide it as Value
, it will override the models value.
Therefore, it should work, if you change your code like this:
@Html.TextBoxFor(model => item.Filepath, new { Value = item.Filepath, Type = "file" })
I'm curious though, does anyone know, why it is implemented like that in razor? I find this behavior pretty confusing, since the HTML attribute names are case insensitive by definition...