Share via


OptionalAttribute Class

Definition

Define a field or property as optional.

[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)]
[System.Serializable]
public class OptionalAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property)>]
[<System.Serializable>]
type OptionalAttribute = class
    inherit Attribute
Public Class OptionalAttribute
Inherits Attribute
Inheritance
OptionalAttribute
Attributes

Remarks

An optional field is one where having no value is an acceptable response. By default every field is considered required and must be filled in to complete the form.

Constructors

OptionalAttribute()

Mark a field or property as optional.

Applies to