Here's what I've found:
@Html.TextBoxFor(c => c.Propertyname, new { @Value = "5" })
works with a capital V, not a lower case v (the assumption being value is a keyword used in setters typically) Lower vs upper value
@Html.EditorFor(c => c.Propertyname, new { @Value = "5" })
does not work
Your code ends up looking like this though
<input Value="5" id="Propertyname" name="Propertyname" type="text" value="" />
Value vs. value. Not sure I'd be too fond of that.
Why not just check in the controller action if the proprety has a value or not and if it doesn't just set it there in your view model to your defaulted value and let it bind so as to avoid all this monkey work in the view?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…