Form batch actions
When deploying form actions, TotalAgility batches multiple sequential form actions that will execute on the server into single HTTP requests to provide the best performance. Each batch of actions in an HTTP request will execute on the server before returning results to the client browser.
Server-side form actions include:
All other form actions are client-side, as they must run in the client browser.
Using client-side form actions intermixed within a sequence of server-side form actions could cause a batch of actions to be split if a client-side form action is placed in the middle of a set of server-side form actions. This will result in multiple HTTP requests, one for each batch of server-side form actions.
The following example shows a sequence of form actions assigned to a form Onload event:
-
DotNet action 1
-
DotNet action 2
-
DotNet action 3
-
SamePage action 1
-
WebService action 1
-
WebService action 2
-
SamePage action 2
As the “SamePage action 1” is placed in the middle of the other server-side form actions, this will result in two batches of form actions, therefore requiring two HTTP requests to be made.
Instead, if the client-side actions are grouped in the sequence as shown below, there will only be a single batch of form actions and a single HTTP request:
-
DotNet action 1
-
DotNet action 2
-
DotNet action 3
-
WebService action 1
-
WebService action 2
-
SamePage action 1
-
SamePage action 2
For best performance, it is recommended to group server-side form actions separately from client-side form actions when assigning to a form event. This will result in the fewest number of HTTP requests being made from the client browser to the server.
This is not always possible if the sequence of the client-side actions is important, that is, if the controls or variables they update are needed for the server-side actions to run correctly.