DatStat Illume 4.5 SDK Class Reference

IDatStatPostBack.PostBack_Hook Method 

This method will be called whenever the participant navigates through the survey.

bool PostBack_Hook(
   HookContext ctx
);

Parameters

ctx
A runtime context used for interacting with the running survey.

Return Value

Return false to prevent the participant from moving off of the current survey page if the post-back action is PostBackActionType.Next, PostBackActionType.Previous, or PostBackActionType.Submit. Return true to allow the requested post-back action to continue normally.

Remarks

The HookContext object will hold the value of the action type in the property PostBackAction. The type of actions are summarized in the Enumeration PostBackActionType. If the call to PostBack_Hook returns true, processing of the participant post-back will continue normally. If the call returns false and the PostBackActionType is Next, Previous, or Submit, the participant will be prevented from moving off of their current page.

Use the ErrorMessage property of the HookContext to force the display of an error or warning at the top of the page that is about to be rendered after this hook is called. When setting the ErrorMessage property, be sure to include well-formed XHTML, or you may break survey page rendering.

Note that in the case of a PostBackAction type of Submit, the submission hasn't actually happened yet and the data are in an uncleaned state. Hence it is possible to prevent the submission by returning false.

Use the HookData property of the HookContext to access an optional custom string passed in by the call to the hook within the survey.

See Also

IDatStatPostBack Interface | DatStat.Collector Namespace | HookContext | PostBackActionType