How can forms submissions be canceled? Below is the current code base that I am working from. I hooked into the form submission event for custom processing, but I need a way to cancel the form submission, if the custom validation fails.
private void FormsEvents_formSubmission(object sender, FormsEventArgs e)
var contentRouteHelper = ServiceLocator.Current.GetInstance();
var submitArgs = e as FormsSubmittingEventArgs;
// cancel subimssion.
submitArgs.CancelAction = true;
submitArgs.CancelReason = "reason";