Click here to Skip to main content
15,867,756 members
Articles / Password
Article

TextBox

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Oct 2013CPOL1 min read 6.3K   1  
The TextBox server control is an input control that lets the user enter text. By default, the TextMode property is set to SingleLine, which creates a

This articles was originally at wiki.asp.net but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

The TextBox server control is an input control that lets the user enter text. By default, the TextMode property is set to SingleLine, which creates a text box with only one line. You can also set the property to MultiLine or Password. MultiLine creates a text box with more than one line. Password creates a single-line text box that masks the value entered by the user.

The display width of the text box is determined by its Columns property. If the text box is a multiline text box, the display height is determined by the Rows property. The display width can also be set by the Width property.

Use the Text property to determine the contents of the TextBox control. You can limit the number of characters that can be entered in the control by setting the MaxLength property. Set the Wrap property to true to specify that the contents of the cell should automatically continue on the next line when the end of the text box is reached.

 

An example: 

<asp:TextBox ID="EmailText" runat="server" MaxLength="100"/>

A textbox class would render and Input of Type Text in the client HTML. The markup rendered by default for this control might not conform to accessibility standards such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see ASP.NET Controls and Accessibility.

 

 

This article was originally posted at http://wiki.asp.net/page.aspx/318/textbox

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
This is a Collaborative Group

755 members

Comments and Discussions

 
-- There are no messages in this forum --