79264508

Date: 2024-12-09 09:55:37
Score: 2.5
Natty:
Report link

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...

Reasons:
  • RegEx Blacklisted phrase (2): does anyone know
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Canabale