...
Usually, your routine will either have all client-side or all server-side steps. In other words, it is either a client-side routine or a server-side routine. However, sometimes it may make sense to mix the two types of steps. For example, this would allow you to enforce client-side validation or to update client-side values before they are sent to the server.
For evenevent-driven routines, all client-side steps will occur before control is passed to the server, regardless of how they are arranged in the routine. For screen initialization routines, the server-side steps occur before client-side steps.
...