/// <summary> /// Handles the BeforeLoadingForm event of the XFormControl. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EPiServer.XForms.WebControls.LoadFormEventArgs"/> instance containing the event data.</param> public void XForm_BeforeLoadingForm(object sender, LoadFormEventArgs e) { XFormControl formControl = (XFormControl)sender; //We set the validation group of the form to match our global validation group in the master page. formControl.ValidationGroup = "XForm"; }
/// <summary> /// Handles the BeforeLoadingForm event of the XFormControl. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EPiServer.XForms.WebControls.LoadFormEventArgs"/> instance containing the event data.</param> public void XForm_BeforeLoadingForm(object sender, LoadFormEventArgs e) { XFormControl formControl = (XFormControl)sender; if (String.IsNullOrEmpty(formControl.ValidationGroup)) { //We set the validation group of the form to match our global validation group in the master page if no group has been defined. formControl.ValidationGroup = "XForm_" + Guid.NewGuid().ToString(); } }