FormComponentGetModelPropertyCustomAttributesT Method |
Gets a collection of custom attributes applied to the model's property
this form component represents.
Namespace: Kentico.Forms.Web.MvcAssembly: Kentico.Content.Web.Mvc (in Kentico.Content.Web.Mvc.dll) Version: 12.0.0
Syntax public IEnumerable<T> GetModelPropertyCustomAttributes<T>(
bool inherit
)
where T : Attribute
Parameters
- inherit
- Type: SystemBoolean
A value indicating whether to inspect the ancestors of model's property.
Type Parameters
- T
- The type of attribute to search for.
Return Value
Type:
IEnumerableTReturns a collection of the custom attributes, or null if this form component was not instantiated for a model.
Remarks
The enumeration is available for form components created for a strongly typed model only. Form components representing
forms built using the Form builder do not have a strongly typed model bound (i.e. null is returned).
See Also