asp.net - Convert a TextBox text mode single line to multiline

How to convert TextBox TextMode SingleLine to MultiLine
asp.net textbox web server control is a very dynamic control. you can use textbox control as a single line text input control or as a multi line text input control or as a password input control. if you insert a single line mode enabled textbox on web page, then you can convert it as a multiple line input mode textbox control programmatically. to convert the textbox text input mode you need to change the textbox TextMode property value. textbox TextMode MultiLine property is render a html textarea element. this tutorial demonstrate you how can we convert textbox TextMode property SingleLine to MultiLine.
TextBoxMultiLine.aspx

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

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        TextBox1.TextMode = TextBoxMode.MultiLine;
    }
    protected void Button2_Click(object sender, System.EventArgs e)
    {
        TextBox1.TextMode = TextBoxMode.SingleLine;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to convert TextBox TextMode SingleLine to MultiLine</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Green">TextBox Example: SingleLine MultiLine</h2>
        <asp:Label 
             ID="Label1" 
             runat="server"
             Text="Address"
             >
        </asp:Label>
        <asp:TextBox 
             ID="TextBox1" 
             runat="server"
             >
        </asp:TextBox>
        <br /><br />
        <asp:Button 
             ID="Button1" 
             runat="server" 
             ForeColor="Magenta"
             Text="TextBoxMode MultiLine"
             OnClick="Button1_Click"
             Font-Bold="true"
             />
        <asp:Button 
             ID="Button2" 
             runat="server" 
             Font-Bold="true"
             ForeColor="Magenta"
             Text="TextBoxMode SingleLine"
             OnClick="Button2_Click"
             />
    </div>
    </form>
</body>
</html>
Related asp.net example