I want to place the value of a field (property) from model into Html.Label. Something like this:
@Html.Label(item => item.Title)
I don't want a label for item.Title (like Html.LabelFor( model => model.Title)
). But I want to put the value of item.Title
in the label as text (string). So the result in run-time should be like this:
<label>Some Title</label>
How can I do this?
Try this:
@Html.Label(Model.Title)
It should work
EDITED
or this:
<label>@Html.DisplayFor(item => item.Title)</label>