Text Boxes


The TextBox control is used to create a text box where the user can input text. The TextBox control’s attributes and properties include The example demonstrates some of the attributes of the TextBox control:


demo_textbox_ex1.aspx

Web
01<%@ Page Language="C#" %>
02<html>
03 <body>
04  <form runat="server">
05 
06   A basic TextBox:
07   <asp:TextBox id="tb1" runat="server" />
08 
09   A password TextBox:
10   <asp:TextBox id="tb2" TextMode="password" runat="server" />
11 
12   A TextBox with text:
13   <asp:TextBox id="tb3" Text="Hello World!" runat="server" />
14 
15   A multiline TextBox:
16   <asp:TextBox id="tb4" TextMode="multiline" runat="server" />
17 
18   A TextBox with height:
19   <asp:TextBox id="tb5" rows="5" TextMode="multiline"
20     runat="server" />
21 
22   A TextBox with width:
23   <asp:TextBox id="tb6" columns="30" runat="server" />
24 
25  </form>
26 </body>
27</html>