• Documentation

    Elanat Documentation
    The most important feature of Elanat is its add-ons-oriented structure. Add-ons-oriented structure allows you to create your own Add-ons without conflicting with Eanat core.

    WebForms Core Technology - 1.5 WebForms Class and Action Controls

    1.5 WebForms Class and Action Controls

    In WebForms Core, the WebForms class and Action Controls form the server-side command generation layer of the technology.

    The WebForms class provides the programming interface used by the server application to describe changes and actions that should occur in the browser. These operations are converted into Action Controls, which are then sent to WebFormsJS for execution.

    This creates a clear separation of responsibilities:

    - WebForms Class: defines and generates browser operations on the server. - Action Controls: represent those operations in the WebForms Core protocol. - WebFormsJS: parses and executes the Action Controls in the browser.

    WebForms Class

    The WebForms class is the server-side programming interface of WebForms Core. It allows backend code to describe operations that should be performed on the HTML document without manually writing JavaScript for each operation.

    A WebForms class implementation is available for each supported server programming language. The exact programming syntax can therefore differ between languages, while the underlying WebForms Core concepts and protocol remain the same.

    For example, a server application can create an instance of the WebForms class and use its methods to create an element, change its properties, modify its content, remove it, introduce a delay, or change its state.

    These methods do not directly manipulate the browser DOM. Instead, they generate Action Controls that describe the requested operations.

    In this sense, the WebForms class acts as the Commander of the WebForms Core architecture. It determines which operations should be performed, while WebFormsJS acts as the browser-side Runtime and Executor that performs those operations.

    Action Controls

    An Action Control is an executable instruction in the WebForms Core protocol. It represents an operation that WebFormsJS can apply to the browser, usually against an HTML element or another browser-side target.

    Action Controls are generated by the WebForms class from server-side method calls. The server does not need to send a complete replacement HTML document for every interaction. Instead, it can send only the operations required for the current interaction.

    For example, the following WebForms class calls represent several independent operations:

    When the response is generated, these operations become Action Controls in the WebForms Core response.

    The response is not a description of a component tree or a JSON representation of the user interface. It is a sequence of executable WebForms Core instructions.

    From WebForms Class to Action Controls

    The relationship can be represented as:

    The WebForms class therefore provides a higher-level programming interface, while Action Controls provide the protocol-level representation of the requested operations.

    This distinction is important. A developer normally works with WebForms class methods rather than manually constructing the protocol representation. WebFormsJS, on the other hand, receives and executes the resulting Action Controls.

    WebForms Core Example

    The following example demonstrates the complete flow using a simple contact form.

    HTML Page

    To use WebForms Core technology, the WebFormsJS library is added to the <head> section of the HTML page.

    On the server side, the application uses the WebForms class implementation for its programming language. The following example uses C# with the CodeBehind framework.

    C# Example

    When the user submits the form, the request reaches the server. The server processes the submitted data and creates an instance of the WebForms class.

    The WebForms class is then used to generate several browser operations:

    1. Create a new <h3> element inside the <form>.
    2. Set its background color to green.
    3. Set its text to a success message containing the submitted name.
    4. Remove the element after the specified delay.
    5. Disable the submit button.

    The call to form.Response() produces a WebForms Core response containing the generated Action Controls. WebFormsJS receives the response, recognizes the [web-forms] marker, parses the Action Controls, and executes them in the browser.

    What Is Sent from the Client to the Server?

    WebForms Core does not require a special client-side data format for ordinary HTML form submission. The form can submit its data as standard form data.

    The server can therefore process the submitted values using the normal form data mechanisms of the backend environment.

    What Does the Server Send to the Client?

    After processing the request, the server can return a WebForms Core response based on the INI-like protocol syntax.

    Each instruction represents an Action Control. WebFormsJS interprets these instructions and applies them to the current document.

    The important point is that the server does not need to send the resulting HTML document back to the browser. It sends the actions required to transform the existing document.

    Action Controls as Executable Operations

    Action Controls are intentionally different from a static description of the desired user interface.

    For example, a component-oriented system may describe a complete component tree and then determine how that tree should be rendered. In WebForms Core, the server can instead express operations such as adding an element, changing text, modifying an attribute, deleting an element, setting an event, changing state, or performing another supported browser operation.

    This makes the protocol command-oriented. The server can compose different Action Controls at runtime according to the result of application logic.

    For example, server-side code can decide that a particular user should see a message, another user should have a button disabled, and another user should receive a completely different sequence of operations. The browser does not need a prebuilt component definition for each possible combination. It only needs to understand the individual Action Controls supported by WebFormsJS.

    Action Controls and WPC

    Many Action Controls operate on existing HTML elements. WebForms Core uses WebForms Path Criteria (WPC) to identify those elements.

    For example, <h3> can target an h3 element, while (button) can target an element by its name. This allows Action Controls to operate directly on the HTML document without requiring framework-specific component identifiers.

    Consequently, the WebForms class can work with ordinary HTML while Action Controls provide the executable instructions that WebFormsJS applies to that HTML.

    Sequential Execution

    A WebForms Core response can contain multiple Action Controls. WebFormsJS processes the response and executes the operations as part of the defined execution sequence.

    This allows a server response to describe a complete interaction rather than being limited to a single DOM modification.

    In the example above, the response can create the success message, modify it, schedule its removal, and disable the submit button as part of the same server-generated response.

    WebForms Class, Action Controls, and WebFormsJS

    The three layers have distinct responsibilities:

    This architecture separates application logic from browser execution. The server decides what should happen, the Action Controls carry those decisions, and WebFormsJS performs them against the browser.

    Therefore, the WebForms class is not a server-side replacement for the DOM, and Action Controls are not HTML elements themselves. They form the command layer between server-side application logic and browser-side execution.

    From Server Logic to Browser Action

    The complete flow can be summarized as:

    This is one of the central ideas of WebForms Core: server-side code can generate executable browser behavior without requiring application-specific JavaScript for every interaction.

    The WebForms class therefore provides the programming model, Action Controls provide the command representation, and WebFormsJS provides the browser runtime that executes those commands.