In ASP.NET MVC, I wrote below code to give the textbox a initial value:
@Html.TextBoxFor(p => p.WEIGHT, new { tabindex = \"140\",
@Html.TextBoxFor(p => p.WEIGHT, new { tabindex = "140", @class = "mustInputText noime w50", maxlength = "8", @value = model.WEIGHT==null?"0":model.WEIGHT, rule = "InputOnlyNum" })