Home   Cover Cover Cover Cover


From Section 6.4.4 of the book

This example shows a multi-line TextBox as well as how to initiate an immediate round-trip when a TextChanged event occurs. The properties of the TextBox are displayed on the page.

<%@ Page Language="C#" %>
    <script Language="C#" Runat="server">
      void HandleText(object sender, EventArgs e) {
        label.Text = "TextMode=" + box.TextMode
        + ", Rows=" + box.Rows
        + ", Columns=" + box.Columns
        + ", Wrap=" + box.Wrap;
    <form Runat="server">
      <asp:Label ID="label" Runat="server" /><br>
      <asp:TextBox ID="box" TextMode="MultiLine" Rows="3" Columns="15"
        OnTextChanged="HandleText" AutoPostBack="true" Runat="server" />

Ty it

Click on the link below and fill in the TextBox. Then click outside of the TextBox in order to initiate the round-trip.