November Happy Hour will be moved to Thursday December 5th.

Class XFormDataEventArgs

Inheritance
System.Object
System.EventArgs
XFormDataEventArgs
Inherited Members
System.EventArgs.Empty
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.XForms.Util
Assembly: EPiServer.XForms.dll
Version: 9.12.2
Syntax
public class XFormDataEventArgs : EventArgs

Constructors

XFormDataEventArgs(XFormData)

Declaration
public XFormDataEventArgs(XFormData formData)
Parameters
Type Name Description
XFormData formData

Properties

CancelSubmit

Set this value if you want to cancel the form posting. The submission is automatically cancelled if any ErrorMessages has been added to the Event Arguments but it is possible to cancel the post without giving an error message. This can be handy if you want to implement custom logic to how to store or send the form data.

Declaration
public bool CancelSubmit { get; set; }
Property Value
Type Description
System.Boolean

ErrorMessage

Used to set an custom error message if you validate data yourself in the event.

Declaration
public string ErrorMessage { get; set; }
Property Value
Type Description
System.String

A string containing either the last ErrorMessage or String.Empty if no ErrorMessage has been added.

Remarks

This will add a string to the ErrorMessages property. It is possible to add several Error Messages by simply setting this property more than once.

ErrorMessages

Returns an Array of Strings containing all ErrorMessages for the event arguments.

Declaration
public string[] ErrorMessages { get; }
Property Value
Type Description
System.String[]

An Array of String objects. If no messages have been added an empty Array will be returned.

FormData

The actual form data that is being posted.

Declaration
public XFormData FormData { get; }
Property Value
Type Description
XFormData
Remarks

This can be used to validate posted data or to add custom data.

Examples

An example of how to set a custom value for form data.

e.FormData.SetValue("mycustomvalue", "12345");

Extension Methods