asp.net Atlas Simple control introduction four controls

Source: Internet
Author: User
Tags abstract client
Asp.net| Control


The client controls in Atlas inherit or indirectly inherit from the Sys.UI.Control base class (refer to the two base classes introduced by the ASP.net Atlas simple control) and are extended, and this article introduces the simple controls built in Atlas Inputcontrol,textbox , Button and checkbox.

Sys.UI.InputControl

The Inputcontrol class is an abstract class that serves as a base class for all controls that provide user input (for example, a textbox, see below), providing a public operation such as input data validation. The Inputcontrol abstract class provides the following properties:

IsValid: This property is read-only and returns a Boolean value that indicates whether the input data is validated after validation, that is, whether all validator are passed (refer to: Create a custom validator in ASP.net atlas).

Validationmessage: This property is read-only, returns a string. When the validation fails, it contains the first validator error message that caused the failure, or an empty string if the validation succeeds.

Validators: Returns the validator collection of the Inputcontrol that enables you to add/remove a validator to authenticate user input.
Sys.UI.TextBox

A TextBox control is one of the controls that any GUI must provide, and one of our most common and user-interaction controls. The textbox in Atlas encapsulates the DOM element input for type input, or the DOM element textarea, inherited from the Inputcontrol base class to obtain input data validation functionality. The textbox provides the following properties.

Text: Gets or sets the text in the TextBox.

Because the textbox is very commonly used in practical programming, we often need to extend it.

Sys.UI.Button

Button controls are equally important in the GUI. Atlas extends the button concept in the DOM element so that the button does not simply refer to the type as a button or submit HTML INPUT element, but can also be applied to elements such as SPAN,A, providing a unified programming interface for developers. The button provides the following two properties:

Command: Gets or sets a string that represents the name of the command that is thrown by the button. When the button's parent control allows event bubbling, the parent control's OnBubbleEvent event handler can access the property to get the name of the command that the button passed over.

Argument: Gets or sets a string that represents the command arguments that are thrown by the button. When the parent control of the button allows event bubbling, the property can be accessed by the parent control's OnBubbleEvent event handler to get the arguments passed by the button.

The above two properties are useful in some cases, and you can see their actual application in client paging navigation using the ASP.net Atlas pagenavigator control.

The button also provides the following events:

Click: Triggers when the button is clicked.

Note: When a button is clicked, the button's Click event is triggered first, and then the OnBubbleEvent event of the button's parent control is triggered.

Sys.UI.CheckBox

The checkbox in Atlas encapsulates the input DOM element with the type as a checkbox. The user can use it to enter a Boolean value. A checkbox provides the following properties:

Checked: Gets or sets the Boolean value that represents whether the checkbox is selected.

The checkbox also provides the following events:

Click: triggers when the checkbox is clicked.

The controls mentioned in this article are very simple, so omit the sample program and welcome you to leave a comment or ask your question. In the next article, I'll introduce the Select,hyperlink,label and image controls.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.