Class FieldConfiguration
Holds configuration data for a form field.
Inheritance
Inherited Members
Namespace: ChameleonForms.Component.Config
Assembly: ChameleonForms.Core.dll
Syntax
public class FieldConfiguration : IFieldConfiguration, IHtmlContent, IReadonlyFieldConfiguration
Constructors
| Improve this Doc View SourceFieldConfiguration()
Constructs a field configuration.
Declaration
public FieldConfiguration()
Properties
| Improve this Doc View SourceAppendedHtml
A list of HTML to be appended to the form field in ltr order.
Declaration
public IEnumerable<IHtmlContent> AppendedHtml { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Html.IHtmlContent> |
Attributes
Attributes to add to the form element's HTML.
Declaration
public HtmlAttributes Attributes { get; }
Property Value
| Type | Description |
|---|---|
| HtmlAttributes |
Bag
A dynamic bag to allow for custom extensions using the field configuration.
Declaration
public dynamic Bag { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
DisplayType
Returns the display type for the field.
Declaration
public FieldDisplayType DisplayType { get; }
Property Value
| Type | Description |
|---|---|
| FieldDisplayType |
EmptyItemHidden
Whether or not the empty item is hidden.
Declaration
public bool EmptyItemHidden { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ExcludedEnums
Enum value(s) to exclude from the generated field.
Declaration
public Enum[] ExcludedEnums { get; }
Property Value
| Type | Description |
|---|---|
| System.Enum[] |
FalseString
The label that represents false.
Declaration
public string FalseString { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FieldContainerClasses
Any CSS class(es) to use for the field container element.
Declaration
public string FieldContainerClasses { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FieldHtml
The HTML to be used as the field html.
Declaration
public IHtmlContent FieldHtml { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent |
FormatString
The format string to use for the field.
Declaration
public string FormatString { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
HasInlineLabel
Whether or not to use an inline <label>.
Declaration
public bool HasInlineLabel { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasLabelElement
Whether or not to use a <label>.
Declaration
public bool HasLabelElement { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Hint
Get the hint to display with the field.
Declaration
public IHtmlContent Hint { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent |
HintId
The ID to use for a field hint.
Declaration
public string HintId { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
HtmlAttributes
Attributes to add to the form element's HTML.
Declaration
public IDictionary<string, object> HtmlAttributes { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IDictionary<System.String, System.Object> |
InlineLabelText
Gets any text that has been set for an inline label.
Declaration
public IHtmlContent InlineLabelText { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent |
LabelClasses
Any CSS class(es) to use for the field label.
Declaration
public string LabelClasses { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
LabelText
Gets any text that has been set for the label.
Declaration
public IHtmlContent LabelText { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent |
NoneString
The label that represents none.
Declaration
public string NoneString { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
PrependedHtml
A list of HTML to be prepended to the form field in ltr order.
Declaration
public IEnumerable<IHtmlContent> PrependedHtml { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Html.IHtmlContent> |
ShouldInlineLabelWrapElement
Whether or not inline <label> should wrap their <input> element.
Declaration
public bool ShouldInlineLabelWrapElement { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
TrueString
The label that represents true.
Declaration
public string TrueString { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ValidationClasses
Any CSS class(es) to use for the field validation message.
Declaration
public string ValidationClasses { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceAddClass(String)
Adds a CSS class (or a number of CSS classes) to the attributes.
Declaration
public IFieldConfiguration AddClass(string class)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | class | The CSS class(es) to add |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
AddFieldContainerClass(String)
Specify one or more CSS classes to use for the field container element.
Declaration
public IFieldConfiguration AddFieldContainerClass(string class)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | class | Any CSS class(es) to use for the field container element |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
AddLabelClass(String)
Specify one or more CSS classes to use for the field label.
Declaration
public IFieldConfiguration AddLabelClass(string class)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | class | Any CSS class(es) to use for the field label |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
AddValidationClass(String)
Specify one or more CSS classes to use for the field validation message.
Declaration
public IFieldConfiguration AddValidationClass(string class)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | class | Any CSS class(es) to use for the field validation message |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Append(IHtmlContent)
Appends the given HTML to the form field.
Declaration
public IFieldConfiguration Append(IHtmlContent html)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | html | The HTML to append |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Append(Func<Object, IHtmlContent>)
Appends the given HTML to the form field.
Declaration
public IFieldConfiguration Append(Func<dynamic, IHtmlContent> html)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | html | The HTML to append as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Append(String)
Appends the given string to the form field.
Declaration
public IFieldConfiguration Append(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | The string to prepend |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
AsCheckboxList()
Renders the field as a list of radio options for selecting single values or checkbox items for selecting multiple values. Use for a list or boolean value.
Declaration
public IFieldConfiguration AsCheckboxList()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
See Also
| Improve this Doc View SourceAsDropDown()
Renders the field as a drop-down control. Use for a list or boolean value.
Declaration
public IFieldConfiguration AsDropDown()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
AsRadioList()
Renders the field as a list of radio options for selecting single values or checkbox items for selecting multiple values. Use for a list or boolean value.
Declaration
public IFieldConfiguration AsRadioList()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
See Also
| Improve this Doc View SourceAttr(Func<Object, Object>)
Adds or updates a HTML attribute with using a lambda method to express the attribute.
Declaration
public IFieldConfiguration Attr(Func<object, object> attribute)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, System.Object> | attribute | A lambda expression representing the attribute to set and its value |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Attr(String, Object)
Adds or updates a HTML attribute with a given value.
Declaration
public IFieldConfiguration Attr(string key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The name of the HTML attribute to add/update |
| System.Object | value | The value of the HTML attribute to add/update |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Attrs(IDictionary<String, Object>)
Adds or updates a set of HTML attributes using a dictionary to express the attributes.
Declaration
public IFieldConfiguration Attrs(IDictionary<string, object> attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<System.String, System.Object> | attributes | A dictionary of attributes |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Attrs(IDictionary<String, String>)
Adds or updates a set of HTML attributes using a dictionary to express the attributes.
Declaration
public IFieldConfiguration Attrs(IDictionary<string, string> attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<System.String, System.String> | attributes | A dictionary of attributes |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Attrs(Func<Object, Object>[])
Adds or updates a set of HTML attributes using lambda methods to express the attributes.
Declaration
public IFieldConfiguration Attrs(params Func<object, object>[] attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, System.Object>[] | attributes | A list of lambas where the lambda variable name is the name of the attribute and the value is the value |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Attrs(Object)
Adds or updates a set of HTML attributes using anonymous objects to express the attributes.
Declaration
public IFieldConfiguration Attrs(object attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | attributes | An anonymous object of attributes |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Cols(Int32)
Sets the number of cols for a textarea to use.
Declaration
public IFieldConfiguration Cols(int numCols)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | numCols | The number of cols for the textarea |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Disabled(Boolean)
Sets the field to be disabled (value not submitted, can not click).
Declaration
public IFieldConfiguration Disabled(bool disabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disabled |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Exclude(Enum[])
Excludes one or more Enum values from the generated field.
Declaration
public IFieldConfiguration Exclude(params Enum[] enumValues)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Enum[] | enumValues | The value of Enum(s) to exclude from the generated field. |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration |
GetBagData<TData>(String)
Returns data from the Bag stored in the given property or default(TData) if there is none present.
Declaration
public TData GetBagData<TData>(string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName | The name of the property to retrieve the data for |
Returns
| Type | Description |
|---|---|
| TData | The data from the Bag or default(TData) if there was no data against that property in the bag |
Type Parameters
| Name | Description |
|---|---|
| TData | The type of the expected data to return |
HideEmptyItem()
Hide the empty item that would normally display for the field.
Declaration
public IFieldConfiguration HideEmptyItem()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Id(String)
Override the default id for the field.
Declaration
public IFieldConfiguration Id(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | The text to use for the id |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
InlineLabel(IHtmlContent)
Sets an inline label for a checkbox.
Declaration
public IFieldConfiguration InlineLabel(IHtmlContent labelHtml)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | labelHtml | The html to use for the label |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
InlineLabel(Func<Object, IHtmlContent>)
Sets an inline label for a checkbox.
Declaration
public IFieldConfiguration InlineLabel(Func<dynamic, IHtmlContent> labelHtml)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | labelHtml | The html to use for the label as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
InlineLabel(String)
Sets an inline label for a checkbox.
Declaration
public IFieldConfiguration InlineLabel(string labelText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | labelText | The text to use for the label |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
InlineLabelWrapsElement(Boolean)
Specify that inline labels should wrap their input element. Important for bootstrap.
Declaration
public IFieldConfiguration InlineLabelWrapsElement(bool wrapElement = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | wrapElement | True if the input element should be wrapped. |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Label(IHtmlContent)
Override the default label for the field.
Declaration
public IFieldConfiguration Label(IHtmlContent labelHtml)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | labelHtml | The text to use for the label |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Label(Func<Object, IHtmlContent>)
Override the default label for the field.
Declaration
public IFieldConfiguration Label(Func<dynamic, IHtmlContent> labelHtml)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | labelHtml | The text to use for the label as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Label(String)
Override the default label for the field.
Declaration
public IFieldConfiguration Label(string labelText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | labelText | The text to use for the label |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Max(Decimal)
Sets the maximum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Max(decimal max)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Decimal | max | The maximum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Max(Int64)
Sets the maximum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Max(long max)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | max | The maximum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Max(String)
Sets the maximum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Max(string max)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | max | The maximum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Min(Decimal)
Sets the minimum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Min(decimal min)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Decimal | min | The minimum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Min(Int64)
Sets the minimum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Min(long min)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | min | The minimum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Min(String)
Sets the minimum value to accept for numeric text controls.
Declaration
public IFieldConfiguration Min(string min)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | min | The minimum value to accept |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
OverrideFieldHtml(IHtmlContent)
Override the HTML of the form field.
This gives you ultimate flexibility with your field HTML when it's not quite what you want, but you still want the form template (e.g. label, surrounding html and validation message).
Declaration
public IFieldConfiguration OverrideFieldHtml(IHtmlContent html)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | html | The HTML for the field |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
OverrideFieldHtml(Func<Object, IHtmlContent>)
Override the HTML of the form field.
This gives you ultimate flexibility with your field HTML when it's not quite what you want, but you still want the form template (e.g. label, surrounding html and validation message).
Declaration
public IFieldConfiguration OverrideFieldHtml(Func<dynamic, IHtmlContent> html)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | html | The HTML for the field as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Placeholder(String)
Sets a hint to the user of what can be entered in the field.
Declaration
public IFieldConfiguration Placeholder(string placeholderText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | placeholderText | The text to use for the placeholder |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Prepend(IHtmlContent)
Prepends the given HTML to the form field.
Declaration
public IFieldConfiguration Prepend(IHtmlContent html)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | html | The HTML to prepend |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Prepend(Func<Object, IHtmlContent>)
Prepends the given HTML to the form field.
Declaration
public IFieldConfiguration Prepend(Func<dynamic, IHtmlContent> html)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | html | The HTML to prepend as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Prepend(String)
Prepends the given string to the form field.
Declaration
public IFieldConfiguration Prepend(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | The string to prepend |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Readonly(Boolean)
Sets the field to be readonly (value can not be modified).
Declaration
public IFieldConfiguration Readonly(bool readonly = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | readonly |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Required(Boolean)
Sets the field to be required.
Declaration
public IFieldConfiguration Required(bool required = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | required |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Rows(Int32)
Sets the number of rows for a textarea to use.
Declaration
public IFieldConfiguration Rows(int numRows)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | numRows | The number of rows for the textarea |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
SetField(IHtmlContent)
Sets the field that the field configuration is wrapping so that a call to ToHtmlString() will output the given field.
Declaration
public void SetField(IHtmlContent field)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | field | The field being configured |
SetField(Func<IHtmlContent>)
Sets a lambda expression to get the field that the field configuration is wrapping so that a call to ToHtmlString() will output the given field.
Declaration
public void SetField(Func<IHtmlContent> field)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<Microsoft.AspNetCore.Html.IHtmlContent> | field | A lambda returning the HTML to output |
SetField(Func<Object, IHtmlContent>)
Sets the field that the field configuration is wrapping so that a call to ToHtmlString() will output the given field.
Declaration
public void SetField(Func<dynamic, IHtmlContent> field)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | field | The field being configured as a templated razor delegate |
Step(Decimal)
Sets the stepping interval to use for numeric text controls.
Declaration
public IFieldConfiguration Step(decimal step)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Decimal | step | The stepping interval |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
Step(Int64)
Sets the stepping interval to use for numeric text controls.
Declaration
public IFieldConfiguration Step(long step)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | step | The stepping interval |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithFalseAs(String)
Change the label that represents false.
Declaration
public IFieldConfiguration WithFalseAs(string falseString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | falseString | The label to use as false |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithFormatString(String)
Uses the given format string when outputting the field value.
Declaration
public IFieldConfiguration WithFormatString(string formatString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatString | The format string to use |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithHint(IHtmlContent)
Supply a HTML hint to display along with the field.
Declaration
public IFieldConfiguration WithHint(IHtmlContent hint)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Html.IHtmlContent | hint | The hint markup |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithHint(Func<Object, IHtmlContent>)
Supply a HTML hint to display along with the field.
Declaration
public IFieldConfiguration WithHint(Func<dynamic, IHtmlContent> hint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | hint | The hint markup as a templated razor delegate |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithHint(String)
Supply a string hint to display along with the field.
Declaration
public IFieldConfiguration WithHint(string hint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | hint | The hint string |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithHintId(String)
Specify an ID to use for a field hint.
Declaration
public IFieldConfiguration WithHintId(string hintId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | hintId | The ID to use |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithNoneAs(String)
Change the label that represents none.
Declaration
public IFieldConfiguration WithNoneAs(string noneString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | noneString | The label to use as none |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithoutInlineLabel()
Specify that no inline label should be generated.
Declaration
public IFieldConfiguration WithoutInlineLabel()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithoutLabelElement()
Don't use a <label>, but still include the label text for the field.
Declaration
public IFieldConfiguration WithoutLabelElement()
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WithTrueAs(String)
Change the label that represents true.
Declaration
public IFieldConfiguration WithTrueAs(string trueString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | trueString | The label to use as true |
Returns
| Type | Description |
|---|---|
| IFieldConfiguration | The IFieldConfiguration to allow for method chaining |
WriteTo(TextWriter, HtmlEncoder)
Called when form component outputted to the page; writes the form content HTML to the given writer.
Declaration
public void WriteTo(TextWriter writer, HtmlEncoder encoder)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.TextWriter | writer | The writer to write to |
| System.Text.Encodings.Web.HtmlEncoder | encoder | The HTML encoder to use when writing |