Tri-part events are a special code snippets that provide a convenient way of programming interactions between the browser and the webserver.
Why three parts?
Any web application consists of two parts – server and client. The client part runs in the browser on the computer of the web site visitor. This part takes care of all user interface interactions, such as buttons, input controls, blocks of text and images. Client-side code is written in Javascript in most cases.
Server part – this code runs on the webserver itself and has direct access to the database, can send emails, read and write files to the disk. In PHPRunner-created applications server code language is PHP, ASPRunner.NET uses C# or VB.NET, ASPRunnerPro uses Classic ASP.
Most real-life tasks though require a joint action of both client and server parts. For example, the user presses a button and wants something changed in the database, or an email being sent.
Tri-part events provide a relatively easy way to create such integrated code snippets.
They consist of three parts running one after another:
- Client Before – this Javascript code is run immediately after user’s action such as pressing the button.
- Server – this part runs on the server after the Client Before part has finished. You can only user server-side code here (PHP, C# or ASP).
- Client After – back to the web browser, another Javascript code part.
Continue Reading "Tri-part events" →