SyntaxFix
Write A Post
Hire A Developer
Questions
If you have a partial page form for both editing and adding, then the trick I use to default value to 0 is to do the following:
0
@Html.TextBox("Age", Model.Age ?? 0)
That way it will be 0 if unset or the actual age if it exists.