New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI Form TagHelper FormTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("kendo-form")]
[HtmlTargetElement("kendo-form", ParentTag = "editable")]
[HtmlTargetElement("wizard-step-form", ParentTag = "wizard-step")]
[RestrictChildren("form-items", new string[] { "messages", "validatable", "grid", "buttons-template", "form-smart-paste" })]
[OutputElementHint("form")]
public class FormTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperBaseFormTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.VerifySettings()TagHelperBase.SerializeTemplates()TagHelperBase.GenerateId(TagHelperOutput)TagHelperBase.CreateHandler(string)TagHelperBase.GetRangeValidationParameter<TValue>(ModelExplorer, string)TagHelperBase.ExtractEditFormat(string)TagHelperBase.ToDictionaryHandler(IDictionary<string, string>)TagHelperBase.AddSelfToTemplate(TagHelperContext)TagHelperBase.ViewContextTagHelperBase.GeneratorTagHelperBase.InitializerTagHelperBase.WriterTagHelperBase.ScriptAttributesTagHelperBase.NameTagHelperBase.IdTagHelperBase.SelectorTagHelperBase.IdPrefixTagHelperBase.IsInClientTemplateTagHelperBase.DeferredTagHelperBase.AsModuleTagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-form name="form" form-data="@Model" method="POST" asp-controller="Form" asp-action="Tag_Helper">
       <validatable validate-on-blur="true" validation-summary="true" />
       <form-items>
           <form-item type="group">
               <item-label text="Registration Form" />
               <form-items>
                   <form-item field="FirstName">
                       <item-label text="First Name:" />
                   </form-item>
                   <form-item field="LastName">
                       <item-label text="Last Name:" />
                   </form-item>
               </form-items>
           </form-item>
       </form-items>
   </kendo-form>

Constructors

Initializes a new instance of the FormTagHelper class.

C#
public FormTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

Specifies the template which is used for rendering the Form buttons.

C#
public string ButtonsTemplate { get; set; }

Specifies the template which is used for rendering the Form buttons. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string ButtonsTemplateHandler { get; set; }

Specifies the template which is used for rendering the Form buttons. This option expects the ID of the script element that contains the template.

C#
public string ButtonsTemplateId { get; set; }

Specifies the template which is used for rendering the Form buttons. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent ButtonsTemplateView { get; set; }

Specifies if the clearButton should be rendered on initialization.

C#
public bool? ClearButton { get; set; }

Specifies if the first editor of the form will be focused on initialization.

C#
public bool? FocusFirst { get; set; }

Callback function that could be used to change the default format of the automatically generated labels.

C#
public string FormatLabel { get; set; }

Provides the data model of the Form. The widget renders the form fields based on their data type, unless the items option is specified.

C#
public object FormData { get; set; }

Specifies whether the TagHelper is nested.

C#
[HtmlAttributeNotBound]
public bool IsNested { get; }

Specify the layout of Form content. Valid options are: grid: This is equivalent to display: grid. It defines the form element as a grid container and establishes a new grid formatting context for its contents..

C#
public string Layout { get; set; }

The name of the JavaScript function that will handle the change event. Triggered when the form model is updated.

C#
public string OnChange { get; set; }

The name of the JavaScript function that will handle the clear event. Triggered when the form is cleared.

C#
public string OnClear { get; set; }

The name of the JavaScript function that will handle the submit event. Triggered when the form is submitted.

C#
public string OnSubmit { get; set; }

The name of the JavaScript function that will handle the validate event. Fired when the validation of the entire form completes.

C#
public string OnValidate { get; set; }

The name of the JavaScript function that will handle the validateField event. Fired when the validation state of a field changes.

C#
public string OnValidateField { get; set; }

Configures the Form orientation. Available options are "horizontal" and "vertical".By default, the Form is rendered with vertical orientation.

C#
public string Orientation { get; set; }

Sets a value controlling the size of the input.

C#
public ComponentSize? Size { get; set; }

Represents a collection of templates defined for the component.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

Methods

Gets the initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

The initialization script.

Overrides: TagHelperBase.GetInitializationScript()

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelper.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: TagHelperBase.Serialize()

SerializeEvents method.

C#
protected override Dictionary<string, object> SerializeEvents()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeEvents()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: TagHelperBase.SerializeSettings()

Writes the HTML output.

C#
protected override void WriteHtml(TagHelperOutput output)
Parameters:outputTagHelperOutput

The TagHelper output.

Overrides: TagHelperBase.WriteHtml(TagHelperOutput)