Introduction to ASP. NET Atlas simple controls -- sys. component base class and SYS. UI. Control Base Class

Source: Internet
Author: User

Author:Dflying Chen(Http://dflying.cnblogs.com/)

This series has three articlesArticle:

    1. ASP. NET AtlasIntroduction to simple controls-- SYS. ComponentBase class andSYS. UI. ControlBase Class
    2. ASP. NET AtlasIntroduction to simple controls-- Inputcontrol,Textbox,ButtonAndCheckbox
    3. ASP. NET AtlasIntroduction to simple controls-- Label,Hyperlink,SelectAndImage

This is the first article: Asp. net Atlas introduction to simple controls -- sys. component base class and sys. UI. control base class
Asp. net Atlas introduces the client control concept, use object-oriented thinking to add JavaScript elements to be operated Dom encapsulated, it brings a clearer Code model and better reusability (the disadvantage is that the efficiency is reduced ). Atlas client controls are connection JavaScript and Dom element Bridge, we should try to use client controls to deal with Dom elements, we use the Atlas method to compile our Program . At the same time, Atlas powerful extensions to JavaScript object-oriented (see: Asp. net Atlas JavaScript extension ), it also makes it easy for us to build custom controls through inheritance, overwriting, and other methods.

In the previous posts, I introduced someAtlasComplex controls. But at the same time,AtlasIt also provides some relatively simple/Basic client controls are also very useful in development, so that we can familiarize ourselves with this series.AtlasBuilt-in simple client control.

AllAtlasAll client controls are inherited fromSYS. UI. ControlBase class, at the same timeSYS. UI. ControlInherited fromSYS. ComponentBase class. Let's take a lookSYS. ComponentProvided attributes:

  1. ID:AtlasThe identifier of the component.AtlasClient components andDomElement. ThisIDValue andDomElementIDSame attribute value,AtlasUse thisIDTo find the relevantDomElement.
  2. Bindings: The binding set of the component. AboutAtlasSee:AtlasSecrets--BIND (Binding).
  3. Datacontext: The operation object bound to the component. If you set this attribute, all bound entries inherit this object by default, but you can also override this default setting in the binding declaration.
  4. Isinitialized: Boolean value, indicating whether the component has been initialized. Read-only.
  5. Isupdating: Whether the component is being updated.Beginupdate ()Method to callEndupdate ()Method period:True, Other time isFalse. Read-only.

SYS. ComponentThe following methods are also provided:

    1. BeginupdateAndEndupdate: Depending on the implementation of the base class, you can call these two methods to delay or update a batch of components together to improve performance or reduce screen flickering.
    2. Initialize: Constructor. It does not need to be repeated. The Inheritance class can expand this method and initialize its own members.

There are also the following events:

    1. Propertychanged: This event should be triggered when a property of the component changes.AtlasThe binding implementation depends on this event.

Now let's take a lookSYS. UI. ControlProvided attributes:

  1. Accesskey: Get or set the control'sAccesskey, This attribute isDomElementAccesskeyProperty packaging.
  2. Associatedelement: Return controlsDomElement. This attribute should be passed in to the control constructor and cannot be modified after the constructor is constructed.
  3. Behaviors:BehaviorSet. AboutAtlasInBehavior, See:InASP. NET AtlasCreate a customBehavior.
  4. Cssclass: Get or set the control'sCSS class, This attribute isDomElementClassProperty packaging.
  5. Enabled: Indicates whether the control is enabled. This attribute isDomElementEnabledProperty packaging.
  6. Parent: Gets or sets the parent control of the control.
  7. Style: Obtain the correspondingDomElementStyleAttribute Value.
  8. Tabindex: Get or setTab Index.
  9. Visibilitymode: Gets or sets the display mode when the control is hidden. Optional enumerated values:SYS. UI. visibilitymode. CollapseIndicates that the hidden control does not occupy page space,SYS. UI. visibilitymode. HiddenIndicates that the widget remains in its position when hidden.
  10. Visible: Gets or sets whether the control is visible.

SYS. UI. ControlThe following methods are also provided:

  1. Addcssclass: AddCSS class.
  2. Removecssclass: DeleteCSS class.
  3. Containscssclass: Returns a Boolean value, indicating whether the control has a specifiedCSS class.
  4. Togglecssclass: If the control is not specifiedCSS class.
  5. Focus: Enables the control to obtain the input focus.
  6. Scrollintoview: Scroll the control to the visible area of the screen.
  7. Onbubbleevent: Process the sub-control issued by the ControlBubbleEvent. In this article, you can:UseASP. NET Atlas pagenavigatorControls implement client paging navigationFind the actual application of this method.
  8. Raisebubbleevent: This method callsOnbubbleeventMethod to implementBubbleEvent. In this article, you can:UseASP. NET Atlas pagenavigatorControls implement client paging navigationFind the actual application of this method.

In the following sections, I will introduce inheritance or indirect inheritanceSYS. UI. ControlOfAtlasBuilt-in controls, hopefully not as boring as this 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.