Interface ISection<TModel>
Tagging interface for a ChameleonForms Section with a model type.
Namespace: ChameleonForms.Component
Assembly: ChameleonForms.dll
Syntax
public interface ISection<TModel> : IFormComponent<TModel>, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TModel |
Methods
| Improve this Doc View SourceCreatePartialSection(IHtmlHelper<TModel>)
Returns a section with the same characteristics as the current section, but using the given partial form.
Declaration
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 |
CreatePartialSection<TPartialModel>(IForm<TPartialModel>)
Returns a section with the same characteristics as the current section, but using the given partial form.
Declaration
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 |
Field(IHtmlContent, IHtmlContent, IHtmlContent, ModelMetadata, Boolean, IFieldConfiguration)
Outputs a field with passed in HTML.
Declaration
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 |