Introduce DataBase,Asp.net,JavaScript,Xml,Html,Css,Sql,Php,ASP.NET Controls,AJAX,Tools,HTML,CSS,JavaScript,Open Source Project,WPF,.Net Framework,Linq
Top Recommended Hosting

Asp.net control: Using the TextBox Control

by the3factory 2/29/2008 11:13:00 PM

The TextBox control can be used to display three different types of input fields depending on the value of its TextMode property. The TextMode property accepts the following three values:

  • SingleLine Displays a single-line input field.

  • MultiLine Displays a multi-line input field.

  • Password Displays a single-line input field in which the text is hidden.

You can use the following properties to control the rendering characteristics of the TextBox control (this is not a complete list):

  • AccessKey Enables you to specify a key that navigates to the TextBox control.

  • AutoCompleteType Enables you to associate an AutoComplete class with the TextBox control.

  • AutoPostBack Enables you to post the form containing the TextBox back to the server automatically when the contents of the TextBox is changed.

  • Columns Enables you to specify the number of columns to display.

  • Enabled Enables you to disable the text box.

  • MaxLength Enables you to specify the maximum length of data that a user can enter in a text box (does not work when TextMode is set to Multiline).

  • ReadOnly Enables you to prevent users from changing the text in a text box.

  • Rows Enables you to specify the number of rows to display.

  • TabIndex Enables you to specify the tab order of the text box.

  • Wrap Enables you to specify whether text word-wraps when the TextMode is set to Multiline.

The TextBox control also supports the following method:

  • Focus Enables you to set the initial form focus to the text box.

And, the TextBox control supports the following event:

  • TextChanged Raised on the server when the contents of the text box are changed.

When the AutoPostBack property has the value true, the form containing the TextBox is automatically posted back to the server when the contents of the TextBox changes.

Related posts

Sign up for PayPal and start accepting credit card payments instantly.


Powered by BlogEngine.NET 1.2.0.0