There may be cases where you want to customize the Submit button behaviour, for example to add custom validation. To do this:
-
In the page’s OnPreLoad event, specify that WorkflowGen is NOT to handle the submit:
HandleSubmitButton = false;
-
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”;
-
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.