How to manually handle form submission

There may be cases where you want to customize the Submit button behaviour, for example to add custom validation. To do this:

  1. In the page’s OnPreLoad event, specify that WorkflowGen is NOT to handle the submit:

    HandleSubmitButton = false;

  2. While this prevents WorkflowGen from initializing the ValidationGroup property of the Submit button, the workaround is to initialize it manually in the same page event. The default value is “WFGENPage”:

    submitButton.ValidationGroup = “WFGENPage”;

  3. Create a custom method to assign to the button in the OnPreLoad event.

Note: Make sure to call the web form’s base.OnPreLoad() event, which is managed by WorkflowGen.My.