- How to create a multiline TextBox

TextBox TextMode Property MultiLine
HTML have a tag named TextArea. TextArea tag create a multiline text input control on web page. in environment you can use only one text input web server control named TextBox. but .net developers can create a multiple line text input control as like TextArea by using textbox control. this textbox control render as a html textArea control in web page. textbox server control have a property named TextMode. you set textbox TextMode property value Multiline to generate a multi line textbox control in web form. the following example demonstrate you how can we create and use multi line textbox control in web form.

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">


<html xmlns="">
<head runat="server">
    <title>TextBox example: how to use TextMode property MultiLine</title>
    <form id="form1" runat="server">
        <asp:Label ID="Label1" runat="server" Text="Name" AssociatedControlID="TextBox1"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" TextMode="SingleLine"></asp:TextBox>
        <br />
        <asp:Label ID="Label2" runat="server" Text="Address" AssociatedControlID="TextBox2"></asp:Label>
        <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Width="400px" Height="200px"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Submit" />
Related example