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
<%@ Page Language="C#" %>
<html>
 <body> 
  <form runat="server">

   A basic TextBox:
   <asp:TextBox id="tb1" runat="server" />

   A password TextBox:
   <asp:TextBox id="tb2" TextMode="password" runat="server" />

   A TextBox with text:
   <asp:TextBox id="tb3" Text="Hello World!" runat="server" />

   A multiline TextBox:
   <asp:TextBox id="tb4" TextMode="multiline" runat="server" />

   A TextBox with height:
   <asp:TextBox id="tb5" rows="5" TextMode="multiline"
     runat="server" />

   A TextBox with width:
   <asp:TextBox id="tb6" columns="30" runat="server" />

  </form>
 </body>
</html>