0

I have a strongly typed model and it is grabbing the display name from the Database 'startAmount' which I am sure is what it is supposed to do, but how do I override this?

I want it to appear as 'Starting Amount'.

<p>
@Html.LabelFor(m => m.IPACS_kpiHistory.startAmount)
<span class="field">
@Html.TextBoxFor(m => m.IPACS_kpiHistory.startAmount)
</span>
</p>

I've looked at all of the method options and none of them seem to have a display text override option?

4

1 回答 1

1

你试过这个:

@Html.LabelFor(m => m.IPACS_kpiHistory.startAmount, "Starting Amount")

或者通过使用属性装饰您的视图模型[Display]属性:

[Display(Name = "Starting Amount")]
public double startAmount { get; set; }
于 2013-06-05T20:06:09.863 回答