SiteMap  | About    

Textbox Control

The TextBox server control is an input control which can be used to accept user input.


By default Texboxes comes with a single line of text , you can also use the TextBox control to display a multiline text box or a text box that masks user input by changing the value of the TextMode property to TextBoxMode.MultiLine

  TextBox1.TextMode = TextBoxMode.MultiLine


  TextBox1.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine;

If you want to limit the user input to a specified number of characters, set the MaxLength property.

  TextBox1.MaxLength = 5


  TextBox1.MaxLength = 5;

The following ASP.NET program retrieve user input from a TextBox control and display it to a Label control.



<html xmlns="">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
	<form id="form1" runat="server">
	   <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
	   <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
	   <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Click the following links to see full source code

C# Source Code
VB.NET Source Code
default.aspx.vb (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.