I'm working on an MVC project using C#. Right now, I'm trying to customize my views a little, and I'd like to make the text boxes bigger.
I followed the suggestions in this question to move from a single-line to a multi-line text field: Changing the size of Html.TextBox
Now I'm trying to resize that multi-line field, but I'm not sure where or how to do so.
Here are snippets from my Edit view
<div class="editor-label">
@Html.LabelFor(model => model.Body)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Body)
@Html.ValidationMessageFor(model => model.Body)
</div>
and from my model:
[DataType(DataType.MultilineText)]
[DisplayName("Body:")]
public string Body { get; set; }
To adhere to a previously created view style, you can also do this:
In MVC 5 you can use
Works nicely!
If you are using mvc and bootstrap try this:
try
@Html.TextAreaFor(model => model.Descricao, 5, 50, null)
in View Page
I just wanna share in mvc 5
or use a custom class
I would do this with CSS:
and then in your CSS file define the width and height to the desired values: