Tri-part events are a system of interconnected events that provides a convenient way to design the interaction between the browser and web server.
Here is how the Tri-part event interface looks like when adding a Custom button:
The server part runs the code on the web server itself and has direct access to the database, can send emails, read and write files to the disk. The ASPRunner.NET applications, use C#/VB.NET as the server code language.
Most real-life tasks require a joint action of both client and server parts. For example, the user clicks a button to change something in the database, or send an email.
Tri-part events provide a convenient way to create such integrated code snippets.
They consist of three parts running one after another:
It's essential that a functional Tri-part event be able to pass data between its parts. For example, the Client Before part receives input from the user, passes it to the Server event. The latter runs some database queries using the data and passes the results to Client after, which shows the results to the user.
Two objects serve as links between the three parts of the event:
•params object passes data from the Client Before to the Server event.
•result object passes data from the Server to the Client After event.
The key names, users, and variables are up to you. You can choose any names here.
You can also pass arrays and objects this way:
Three features utilize Tri-part events:
All these events work in the same way. The only difference between them is how users initiate the event - by clicking the button, interacting with an input control, or by clicking somewhere in the data grid.
If you don't need the Server part, return false in the Client Before code:
ASPRunner.NET passes the following parameters to the ClientBefore and ClientAfter events:
a RunnerPage object representing the current page.
a GridRow object that represents a row in the grid. Buttons receive this parameter when positioned in the data grid on the List page. Field events receive it in the Inline Add/Edit mode.
in the Field events, this parameter represents the input control itself. It is a RunnerControl object.