JavaScript
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Allows controls to execute javascript code.
- C#
- VB.NET
public class JavaScript : Component, IExtenderProvider
Public Class JavaScript
Inherits Component
Implements IExtenderProvider
Constructors
JavaScript()
Initializes a new instance of the JavaScript without a specified container.
JavaScript(container)
Initializes a new instance of the JavaScript class with a specified container.
| Name | Type | Description |
|---|---|---|
| container | IContainer | An IContainer that represents the container of the JavaScript extender. |
Properties
Tag
Object: Returns or sets the object that contains programmer-supplied data associated with the JavaScript extender. (Default: null)
Methods
CanExtend(target)
Returns true if the JavaScript extender can offer an extender property to the specified target component.
| Parameter | Type | Description |
|---|---|---|
| target | Object | The target object to add an extender property to. |
Returns: Boolean. true if the JavaScript class can offer one or more extender properties; otherwise, false.
Clear()
Removes all scripts.
Dispose(disposing)
Disposes the component and removes it from the design container.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
GetJavaScript(control)
Retrieves the JavaScript code associated with the specified control. The JavaScript code will be execute on the client when the control is created or refreshed.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The Control for which to retrieve the JavaScript code. |
Returns: String. A String containing the javascript code for the specified control.
GetJavaScriptEvents(control)
Returns the collection of JavaScript event handlers associated with the control.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The Control to attach the JavaScript event handlers to. |
Returns: ClientEventCollection.
GetJavaScriptSource(control)
Retrieves the JavaScript file associated with the specified control. The JavaScript code will be execute on the client when the control is created or refreshed.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The Control for which to retrieve the JavaScript file. |
Returns: String. A String containing the name of the javascript file for the specified control.
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
SetJavaScript(control, script)
Associates JavaScript code with the specified control.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The Control to associate the JavaScript with. |
| script | String | The JavaScript code to execute when the control is created. |
SetJavaScriptSource(control, file)
Associates JavaScript file with the specified control.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The Control to associate the JavaScript file with. |
| file | String | The JavaScript file to execute when the control is created. |
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |