Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a multi line text box in asp.net mvc?

Tags:

How do I create a multi line text box in asp.net mvc?

Probably not specific to asp.net mvc but it is what I am using.

Here is what I have.

<%: Html.TextBox("CommentToAdd", null, new { @class = "input-medium",     TextMode = "MultiLine", Columns = "55", Rows = "10", type = "text", required = "required" })%> 
like image 308
Maestro1024 Avatar asked Apr 16 '13 00:04

Maestro1024


People also ask

How will you create multi-line text box?

Following steps are used to set the Multiline property of the TextBox: Step 1 : Create a textbox using the TextBox() constructor provided by the TextBox class. // Creating textbox TextBox Mytextbox = new TextBox(); Step 2 : After creating TextBox, set the Multiline property of the TextBox provided by the TextBox class.

What is a multi-line text box?

A multiline text box control is a large text box that can display several lines of text or accept this text from user input. Text boxes are often linked to select value lookups and detailed menus. You can place a multiline text box control within a section control.

Which tag add a multi-line text box on the form area?

The <textarea> tag defines a multi-line text input control. The <textarea> element is often used in a form, to collect user inputs like comments or reviews. A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).

Which property allows multiple line input in TextBox?

A multiline text box allows you to display more than one line of text in the control. If the WordWrap property is set to true , text entered into the multiline text box is wrapped to the next line in the control.


1 Answers

just add this attribute to property.

  [DataType(DataType.MultilineText)]    public string CommentsToAdd{ get; set; } 
like image 116
m.shakeri Avatar answered Oct 01 '22 20:10

m.shakeri