Show / Hide Table of Contents

    Class Section<TModel>

    Wraps the output of a form section.

    Inheritance
    System.Object
    FormComponent<TModel>
    Section<TModel>
    Implements
    Microsoft.AspNetCore.Html.IHtmlContent
    ISection
    ISection<TModel>
    IFormComponent<TModel>
    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 Section<TModel> : FormComponent<TModel>, IHtmlContent, ISection, ISection<TModel>, IFormComponent<TModel>, IDisposable
    Type Parameters
    Name Description
    TModel

    The view model type for the current view

    Constructors

    | Improve this Doc View Source

    Section(IForm<TModel>, IHtmlContent, Boolean, IHtmlContent, HtmlAttributes)

    Creates a form section

    Declaration
    public Section(IForm<TModel> form, IHtmlContent heading, bool nested, IHtmlContent leadingHtml = null, HtmlAttributes htmlAttributes = null)
    Parameters
    Type Name Description
    IForm<TModel> form

    The form the message is being created in

    Microsoft.AspNetCore.Html.IHtmlContent heading

    The heading for the section

    System.Boolean nested

    Whether the section is nested within another section

    Microsoft.AspNetCore.Html.IHtmlContent leadingHtml

    Any HTML to output at the start of the section

    HtmlAttributes htmlAttributes

    Any HTML attributes to apply to the section container

    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

    CreatePartialSection(IHtmlHelper<TModel>)

    Returns a section with the same characteristics as the current section, but using the given partial form.

    Declaration
    public ISection<TModel> CreatePartialSection(IHtmlHelper<TModel> partialHelper)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel> partialHelper

    The HTML helper from the partial view

    Returns
    Type Description
    ISection<TModel>

    A section with the same characteristics as the current section, but using the given partial form

    | Improve this Doc View Source

    CreatePartialSection<TPartialModel>(IForm<TPartialModel>)

    Returns a section with the same characteristics as the current section, but using the given partial form.

    Declaration
    public ISection<TPartialModel> CreatePartialSection<TPartialModel>(IForm<TPartialModel> partialModelForm)
    Parameters
    Type Name Description
    IForm<TPartialModel> partialModelForm

    The Form<TModel> from the partial view

    Returns
    Type Description
    ISection<TPartialModel>

    A section with the same characteristics as the current section, but using the given partial form

    Type Parameters
    Name Description
    TPartialModel

    The model type of the partial view

    | Improve this Doc View Source

    Dispose()

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

    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()
    | Improve this Doc View Source

    Field(IHtmlContent, IHtmlContent, IHtmlContent, ModelMetadata, Boolean, IFieldConfiguration)

    Outputs a field with passed in HTML.

    Declaration
    public IFieldConfiguration Field(IHtmlContent labelHtml, IHtmlContent elementHtml, IHtmlContent validationHtml = null, ModelMetadata metadata = null, bool isValid = true, IFieldConfiguration fieldConfiguration = null)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Html.IHtmlContent labelHtml

    The HTML for the label part of the field

    Microsoft.AspNetCore.Html.IHtmlContent elementHtml

    The HTML for the field element part of the field

    Microsoft.AspNetCore.Html.IHtmlContent validationHtml

    The HTML for the validation markup part of the field

    Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata

    Any field metadata

    System.Boolean isValid

    Whether or not the field is valid

    IFieldConfiguration fieldConfiguration

    Optional field configuration

    Returns
    Type Description
    IFieldConfiguration

    A field configuration that can be used to output the field as well as configure it fluently

    Implements

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

    Extension Methods

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