Class Control

Provides the base class for all all ASP.NET AJAX client controls.

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(element: DomElement): Control

When called from a derived class, initializes a new instance of that class. The Control constructor is a complete constructor function. However, because the Control class is an abstract base class, the constructor should be called only from derived classes.

throws

Error.invalidOperation Function

Parameters

  • element: DomElement
          The Sys.UI.DomElement object that the control will be associated with.
    

Returns

Control

Methods

public addCssClass(className: string)

Adds a CSS class to the HTML Document Object Model (DOM) element that the control is attached to. Use the addCssClass method to add a CSS class to a control. If the CSS class has already been added to the control, addCssClass makes no changes to the control.

Parameters

  • className: string
         A string that contains the name of the CSS class to add.
    

public add_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public add_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public beginUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has begun.

public dispose()

Removes the current control from the application. The dispose method releases all resources from the Sys.UI.Control object, unbinds it from its associated HTML Document Object Model (DOM) element, and unregisters it from the application.

public endUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has finished. This method is called by the create method ($create). Sets the isUpdating property of the current Component object to false, calls the initialize method if it has not already been called, and then calls the updated method.

public get_events(): any

Gets an EventHandlerList object that contains references to all the event handlers that are mapped to the current component's events. This member supports the client-script infrastructure and is not intended to be used directly from your code.

Returns

any

 An EventHandlerList object that contains references to all the events and handlers for this component.

public get_id(): string

Gets the ID of the current Component object.

Returns

string

  The id

public get_isInitialized(): boolean

Gets a value indicating whether the current Component object is initialized.

Returns

boolean

 true if the current Component is initialized; otherwise, false.

public get_isUpdating(): boolean

Gets a value indicating whether the current Component object is updating.

Returns

boolean

 true if the current Component object is updating; otherwise, false.

public initialize()

Initializes the current Sys.UI.Control object. The initialize method initializes the control and sets the base Sys.Component.isInitialized property to true. You can override this method to include additional initialization logic for your derived class.

public onBubbleEvent(source: any, args: any): boolean

Called when an event is raised by the raiseBubbleEvent method.

The onBubbleEvent method returns false to make sure that unhandled events propagate (bubble) to the parent control. In derived classes, you should override the onBubbleEvent method and return true when events are handled to prevent the events from bubbling further. For an explanation of bubbling, see Sys.UI.Control raiseBubbleEvent Method.

Parameters

  • source: any
         The object that triggered the event.
    
  • args: any
         The event arguments.
    

Returns

boolean

 false in all cases.

public raiseBubbleEvent(source: any, args: any)

Calls the onBubbleEvent method of the parent control.

When the raiseBubbleEvent method is called, the source object and args values are sent to the onBubbleEvent handler of the current control. If onBubbleEvent returns false, they are sent to the onBubbleEvent handler of the parent control. This process continues until an onBubbleEvent event handler returns true, which indicates that the event has been handled. Any event that bubbles to the Sys.Application instance without being handled is ignored.

Parameters

  • source: any
         The object that triggered the event.
    
  • args: any
         The event arguments.
    

public raisePropertyChanged(propertyName: string)

Raises the propertyChanged event for the specified property.

Parameters

  • propertyName: string
              The name of the property that changed.
    

public removeCssClass(className: string)

Removes a CSS class from the HTML Document Object Model (DOM) element that the control is attached to. Use the removeCssClass method to remove a CSS class from a control. If the CSS class has already been removed from the control, removeCssClass makes no changes to the control.

Parameters

  • className: string
         A string that contains the name of the CSS class to remove.
    

public remove_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public remove_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public set_id(value: string)

Sets the ID of the current Component object.

Parameters

  • value: string

    A string that contains the ID of the component.

public toggleCssClass(className: string)

Toggles a CSS class of the HTML Document Object Model (DOM) element that the control is attached to.

Parameters

  • className: string
         A string that contains the name of the CSS class to toggle.
    

public updated()

Called by the endUpdate method as a placeholder for additional logic in derived classes. Override the updated method in a derived class to add custom post-update logic.