user2962142
user2962142

Reputation: 2066

How can I put text in the textbox HTML helper?

Let's say I'm using the textbox HTML helper:

@Html.TextBoxFor(u=>u.Something)

How can I show some text inside of the textbox when the page loads?

Upvotes: 0

Views: 284

Answers (1)

Brian
Brian

Reputation: 5119

You can do it simply by following this form:

@Html.TextBoxFor(u => u.Something, new { @Value = "Add your value here"})

Upvotes: 3

Related Questions