The TextBox control is used to get the input from the user of the web application.An asp.net textbox has several properties, that we need to be aware of as a developer.
Properties of a TextBox control
1. TextMode Propertry - single-line, multiline, or password.
2. Text - The contents of the textbox.
3. MaxLength - The maximum number of characters allowed in the textbox.
4. ReadOnly - Set this property to true if you don't want the user to change the text in the TextBox.
5. ToolTip - The tooltip is displayed when the mouse is over the control.
6. Columns - The width of the textbox
7. Height - Set the height
8. Width - Set the width
9. AutoPostBack - A Boolean value that specifies whether the control is automatically posted back to the server when the contents change or not. Default is false.
Events of TextBox:
TextChanged - Occurs when the content of the text box changes between posts to the server.
Methods of a TextBox:
Focus - Set input focus onto the control.
To view the properties of the TextBox, Right click on the control, and select Properties. In the properties window, you can also find the events supported by the control.
All these properties can be set at the design time, or at runtime using code.
No comments:
Post a Comment