System.Web.UI.WebControls Namespace TextBox Class
Sets or retrieves a value indicating whether the text content wraps within a multiline text box.
Inline |
<asp:textbox wrap [ = true | false ] ... > |
Script |
TextBox.Wrap [ = true | false ] |
This property accepts or returns only a boolean value, meaning true if a control is enabled, and false if not.
This property is read/write with a default value of true.
Use the Wrap property to specify whether the text displayed in a multiline TextBox control automatically continues on the next line when the text reaches the end of the control.
NOTE: This property is applicable only when the TextMode property is set to TextBoxMode.MultiLine.
The following example demonstrates how to dynamically set the Wrap property to wrap text entered in a TextBox control.
<script language = "C#" runat = "server">
protected void SubmitButton_Click ( Object src, EventArgs e ) {
msg.Text = "Thank you for your comment: <br>" + comments.Text;
}
protected void Check_Change ( Object src, EventArgs e ) {
comments.Wrap = wrapCheckBox.Checked;
comments.ReadOnly = readOnlyCheckBox.Checked;
}
</script>
Show me
TextBox Members