12

I am sure this is very simple, but I haven't found it yet.

I have an Model with a property of Message that I will set in the control.

What is the Html helper for this?

For example,

Html.TextBoxFor(m=> m.Message)

shows me the message, but it's in a textbox. I don't want the textbox, just the value.

Greg

1 Answer 1

28

You can use two syntax:

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

or

@Model.Title

You can read this question for details.

Sign up to request clarification or add additional context in comments.

1 Comment

Shouldn't that be @Model.Message ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.