asp.net - 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 asp.net 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 asp.net web form.
TextBoxTextMode.aspx

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

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>TextBox example: how to use TextMode property MultiLine</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <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" />
    </div>
    </form>
</body>
</html>
Related asp.net example