How to display string property Model

I am sure it is very simple, but I have not found it yet.

I have a model with the Message property that I will specify in the control.

What is the HTML helper for this?

For example,

Html.TextBoxFor(m=> m.Message) 

shows me the message, but it is in the text box. I don't want a text box, just a value.

Greg

+7
asp.net-mvc
source share
1 answer

You can use two syntaxes:

 @Html.DisplayFor(m => m.Message) 

or

 @Model.Title 

You can read this question for details.

+18
source share

All Articles