Show / Hide Table of Contents

    Class Field<TModel>

    Wraps the output of a single form field.

    Inheritance
    System.Object
    FormComponent<TModel>
    Field<TModel>
    Implements
    IFormComponent<TModel>
    Microsoft.AspNetCore.Html.IHtmlContent
    System.IDisposable
    Inherited Members
    FormComponent<TModel>.IsSelfClosing
    FormComponent<TModel>.Form
    FormComponent<TModel>.Initialise()
    FormComponent<TModel>.WriteTo(TextWriter, HtmlEncoder)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ChameleonForms.Component
    Assembly: ChameleonForms.dll
    Syntax
    public class Field<TModel> : FormComponent<TModel>, IFormComponent<TModel>, IHtmlContent, IDisposable
    Type Parameters
    Name Description
    TModel

    The view model type for the current view

    Constructors

    | Improve this Doc View Source

    Field(IForm<TModel>, Boolean, IFieldGenerator, IFieldConfiguration)

    Creates a form field.

    Declaration
    public Field(IForm<TModel> form, bool isParent, IFieldGenerator fieldGenerator, IFieldConfiguration config)
    Parameters
    Type Name Description
    IForm<TModel> form

    The form the field is being created in

    System.Boolean isParent

    Whether or not the field has other fields nested within it

    IFieldGenerator fieldGenerator

    A field HTML generator class

    IFieldConfiguration config

    The configuration values for the field

    Methods

    | Improve this Doc View Source

    Begin()

    Returns the HTML representation of the beginning of the form component.

    Declaration
    public override IHtmlContent Begin()
    Returns
    Type Description
    Microsoft.AspNetCore.Html.IHtmlContent

    The beginning HTML for the form component

    Overrides
    ChameleonForms.Component.FormComponent<TModel>.Begin()
    | Improve this Doc View Source

    Dispose()

    Called when form component is created within a using block: writes the end tag(s) of the component.

    Declaration
    public override void Dispose()
    Overrides
    ChameleonForms.Component.FormComponent<TModel>.Dispose()
    | Improve this Doc View Source

    End()

    Returns the HTML representation of the end of the form component.

    Declaration
    public override IHtmlContent End()
    Returns
    Type Description
    Microsoft.AspNetCore.Html.IHtmlContent

    The ending HTML for the form component

    Overrides
    ChameleonForms.Component.FormComponent<TModel>.End()

    Implements

    IFormComponent<TModel>
    Microsoft.AspNetCore.Html.IHtmlContent
    System.IDisposable

    Extension Methods

    HtmlAttributesExtensions.ToHtmlAttributes(Object)
    HtmlContentExtensions.ToHtmlString(IHtmlContent)
    FieldExtensions.FieldFor<TModel, T>(Field<TModel>, Expression<Func<TModel, T>>, IFieldConfiguration)
    • Improve this Doc
    • View Source
    Back to top © Copyright 2012-2020 MRCollective, Rob Moore, Matt Davies and the contributors to ChameleonForms.