In version 2 of WebForms Core technology, we have added new features to receive client data from the server without requiring user interaction. In this version, by adding the "TriggerEvent" method, we can execute tag events from the server without requiring user interaction. We also provided new features for calling interaction methods including PostBack, GetBack, TagBack, etc. in ActionControls.
What makes this feature truly remarkable is its integration with Server-Sent Events (SSE) and WebSocket technologies. Through these real-time communication channels, the server can instantly trigger DOM events, update UI components, or invoke client-side logic the moment data changes — all without requiring the page to reload or the user to interact.
Imagine being able to:
- Dynamically refresh data-bound controls the instant a database record changes.
- Trigger animations or notifications on connected clients simultaneously across multiple sessions.
- Execute client-side input events such as
click,change, orkeydowndirectly from the server when specific conditions are met.
This transforms WebForms Core into a truly reactive framework — one where the server and client remain in a constant live connection, sharing updates in real time. The combination of TriggerEvent and run invocation methods with SSE and WebSocket enables a new level of interactivity that feels almost magical: the server can now behave as if it were part of the user’s browser.
WebForms Core 2: A Milestone in the History of Web Development
The second version of WebForms Core is not just an update — it’s a true revolution in the world of web development.
Here, the boundary between server and client no longer exists. You no longer need to write thousands of lines of JavaScript for the smallest interaction, or worry about the growing complexity of heavy front-end frameworks.
With WebForms Core 2, just a few lines of server-side code give you full access to client-side data. You can modify its behavior, trigger events, and even update the user interface in real time — without any user action at all.
In other words:
The server is now alive.
It sees, reacts, and communicates directly with the user interface — without any human interaction.
The Server Takes the Lead
In a world where frameworks like React, Vue, and Angular try to simulate interactivity through layers of complex client-side code,
WebForms Core has chosen a different path — it brings the power back to where it belongs: the server.
By leveraging a real-time architecture built on SSE (Server-Sent Events) and WebSocket, the framework can instantly deliver any change or command to the client.
It doesn’t matter whether the trigger comes from a database update or a server-side logic event — within milliseconds, the result appears in the user’s browser — with no reloads, no clicks, no interaction.
When the Server Thinks for You
WebForms Core 2 goes beyond being just another framework — it represents a new philosophy in software development.
A philosophy that asks:
Why build complex middle layers when the server can talk directly to the client?
In this model, developers no longer need to waste time handling front-end details.
They simply define the logic on the server — and the rest, from event to render, happens automatically and seamlessly.
Trigger Event from Server
In the latest update to WebForms Core technology, we have introduced a new server-side method designed to simulate and trigger client-side HTML events directly from the server. This addition enhances the interactivity and automation capabilities of our system by allowing the backend to invoke front-end behaviors programmatically.
How It Works: TriggerEvent(InputPlace, HtmlEventListener, ConstructorName = null)
The TriggerEvent method provides a simple and unified way to trigger a specific HTML event on a target element in the client interface — from the server-side layer.
InputPlace
Identifies the target element or logical input location where the event should occur.
For example:"Button1","UsernameField", etc.HtmlEventListener
Specifies the name of the HTML event to trigger — such as"click","keydown","input", or"focus".ConstructorName(optional)
Defines the constructor type of the event — for example,"MouseEvent","keyboardEvent", or"InputEvent".
If not provided, the system automatically determines the proper constructor based on the event type (making it both flexible and intelligent).
Example Usage
// Simple click event
TriggerEvent("SubmitButton", "click");
// Keyboard event with explicit constructor
TriggerEvent("SearchBox", "keydown", "keyboardevent");
When this method is executed on the server, it sends an instruction to the client to create and dispatch the corresponding DOM event.
This effectively simulates user interaction — such as a click or key press — without requiring direct client-side scripting.
Intelligent Event Handling
One of the most key features of this method is automatic manufacturer detection.
If the ConstructorName parameter is omitted, the system analyzes the provided event name and determines the appropriate event type automatically (e.g., KeyboardEvent for keydown, MouseEvent for click, etc.).
This makes it possible to use the method in a simpler and more natural way while still preserving full control for advanced use cases.
Extensibility
Additional optional parameters — such as event options (bubbles, cancelable, key, code, etc.) — are planned for future versions.
This will allow developers to fine-tune how the event behaves once dispatched, offering greater flexibility for complex UI interactions.
Summary
The new TriggerEvent method bridges the gap between server-side logic and client-side behavior, offering a clean and powerful way to simulate DOM events from backend code.
Key advantages:
- Works entirely from the server-side.
- Supports both manual and automatic event constructor detection.
- Simple to use, yet flexible for future extensions.
- Prepares the foundation for richer event-driven interactions.
Calling Interaction Methods from Server
Calling interaction methods including PostBack, GetBack, TagBack, etc. methods in ActionControls is a powerful feature that allows the developer to send client data back to the server.
The size of the WebFormsJS library in raw mode in version 2.0 is about 250 KB (of course, don't worry! This size will be below 100 kilobytes after minifying and gzip). WebFormsJS is a complex library that includes configuration structures, global variables, and methods. In this library, we have called several methods interactive; the methods: PostBack, GetBack, PutBack, PatchBack, DeleteBack, HeadBack, OptionsBack, TraceBack, ConnectBack, SendBack, TagBack, WebSocketBack, and SSEBack are without a prefix, and the other methods are named with the prefix "cb_". Interactive methods can receive server data as well as stored data. Automatically, after loading HTML pages, the PostBack method is added to the onclick event of all buttons with the "type" attribute with the value "submit". Hence, the ability to send data based on the HTML structure to the server through the WebFormsJS library has been included in this technology. WebForms Core technology is completely RESTful and you can add interactive methods to various events like drag and drop and keyup from the server. However, sometimes we want to send some data to the server without the user having to do anything on the page. As we mentioned in the "Trigger Event" section, we can trigger an event on any HTML element through the server, but in some cases we don't even need to add an event on the page and we need to directly execute interactive methods. In version 2 we can issue a command to call interactive methods from the server and send data to the server if needed.
The following list contains all interactive methods:
- CallPostBack(OutputPlace = null)
- CallGetBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallPutBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallPatchBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallDeleteBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallHeadBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallOptionsBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallTraceBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallConnectBack(Path, OutputPlace = null, UseCurrentEvent = true)
- CallSendBack(Path, Method, IsMultiPart, ContentType, Data, OutputPlace = null, UseCurrentEvent = true)
- CallTagBack(OutputPlace = null, UseCurrentEvent = true)
- CallWebSocketBack(Path, OutputPlace = null)
- CallSSEBack(Path, OutputPlace = null, UseCurrentEvent = true, ShouldReconnect = true, ReconnectTryTimeout = 3000)
The above methods can be executed either after the user interacts with the server and requests it, or while a WebSocket or SSE connection is established.
Example:
form.CallDeleteBack("https://example.com/api/user/{id}");
The above method sends an external request to another server to delete the user.

Top comments (0)