Reputation: 119
I have a text area where users have to write a description. I was wondering how to set a text box so that it is on multiple lines, allowing the user to see what they are writing. What I am looking for is similar to the environment that I am writing this question in.
<div class="form-group">
<div class="col-md-10">
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
</div>
</div>
Upvotes: 0
Views: 1656
Reputation: 356
Or you code have just changed the EditorFor to TextAreaFor like Below
@Html.TextAreaFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
Upvotes: 1
Reputation: 3423
In your model you need to add MultilineText as below:
[DataType(DataType.MultilineText)]
public string Title { get; set; }
Upvotes: 1