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

Kendo UI PromptBox TagHelper

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("kendo-promptbox")]
[RestrictChildren("action-button", new string[] { "end-affix-template", "file-select-button", "messages", "speech-to-text-button", "start-affix-template", "top-affix-template" })]
public class PromptBoxTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperBasePromptBoxTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperBase.MinimumValidatorTagHelperBase.MaximumValidatorTagHelperBase.Init(TagHelperContext)TagHelperBase.Process(TagHelperContext, TagHelperOutput)TagHelperBase.GetInitializator()TagHelperBase.VerifySettings()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-promptbox name="promptBox">
    <action-button enable="true" />
</kendo-promptbox>

Constructors

Initializes a new instance of the PromptBoxTagHelper class.

C#
public PromptBoxTagHelper(IKendoHtmlGenerator generator)
Parameters:generatorIKendoHtmlGenerator

Properties

If set to false, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

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

Defines a custom template for the end affix area. The end affix is positioned after the input field and typically contains action buttons.When the built-in PromptBox buttons are enabled, the authored end-affix content stays in place and the framework backfills any missing built-in controls after it inside the same end-affix container. To adopt a custom element instead of the default control, include ref-promptbox-send-button, ref-promptbox-file-select-button, or ref-promptbox-speech-to-text-button on the authored element. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string EndAffixTemplateHandler { get; set; }

Defines the fill mode for the PromptBox container.

C#
public FillMode? FillMode { get; set; }

Sets the loading state of the Action button. When true, the button displays a stop icon and allows users to cancel ongoing generation.

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

Sets the maximum height of the textarea in pixels. The textarea resizes automatically until it reaches this height. When the content exceeds this height, a scrollbar appears.

C#
public double? MaxTextAreaHeight { get; set; }

Sets the mode of the PromptBox. Available options are "single", "multi", and "auto". single - Displays a single-line input field; multi - Displays a multi-line textarea with configurable rows or auto - Starts as a single line and expands automatically as the user types.

C#
public PromptBoxMode? Mode { get; set; }

The name of the JavaScript function that will handle the blur event. Fires each time the PromptBox loses focus.

C#
public string OnBlur { get; set; }

The name of the JavaScript function that will handle the fileRemove event. Fires each time the user removes a file attachment.

C#
public string OnFileRemove { get; set; }

The name of the JavaScript function that will handle the fileSelect event. Fires each time the user selects files using the File Select button.

C#
public string OnFileSelect { get; set; }

The name of the JavaScript function that will handle the focus event. Fires each time the PromptBox receives focus.

C#
public string OnFocus { get; set; }

The name of the JavaScript function that will handle the input event. Fires each time the user types in the input field.

C#
public string OnInput { get; set; }

The name of the JavaScript function that will handle the inputBlur event. Fires each time the internal input element loses focus.

C#
public string OnInputBlur { get; set; }

The name of the JavaScript function that will handle the inputFocus event. Fires each time the internal input element receives focus.

C#
public string OnInputFocus { get; set; }

The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the PromptBox is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public string OnKendoKeydown { get; set; }

The name of the JavaScript function that will handle the multilineStateChange event. Fires when the PromptBox transitions between single-line and multi-line states in auto mode.

C#
public string OnMultilineStateChange { get; set; }

The name of the JavaScript function that will handle the promptAction event. Fires when the action button is clicked (send or stop). Check e.actionType to determine the action.

C#
public string OnPromptAction { get; set; }

The name of the JavaScript function that will handle the speechToTextClick event. Fires each time the user clicks the Speech to Text button.

C#
public string OnSpeechToTextClick { get; set; }

The name of the JavaScript function that will handle the speechToTextEnd event. Fires when the speech recognition service disconnects.

C#
public string OnSpeechToTextEnd { get; set; }

The name of the JavaScript function that will handle the speechToTextError event. Fires when a speech recognition error occurs.

C#
public string OnSpeechToTextError { get; set; }

The name of the JavaScript function that will handle the speechToTextResult event. Fires when the speech recognition service returns a result.

C#
public string OnSpeechToTextResult { get; set; }

The name of the JavaScript function that will handle the speechToTextStart event. Fires when the speech recognition service begins listening.

C#
public string OnSpeechToTextStart { get; set; }

The name of the JavaScript function that will handle the valueChange event. Fires when the value changes through user input (not programmatic changes).

C#
public string OnValueChange { get; set; }

Sets the placeholder text displayed in the PromptBox when it is empty.

C#
public string Placeholder { get; set; }

Sets the read-only state of the PromptBox. When set to true, the PromptBox content cannot be modified but remains accessible.

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

Sets the number of visible text lines in the textarea. Applies only when the mode is set to "multi".

C#
public double? Rows { get; set; }

Defines a custom template for the start affix area. The start affix is positioned before the input field. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string StartAffixTemplateHandler { get; set; }

Configures the templates for the PromptBox.

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

Implements: ITemplateComponent.Templates

Sets the title attribute of the input or textarea element.

C#
public string Title { get; set; }

Defines a custom template for the top affix area. The top affix is positioned at the top of the content area in multi-line mode only. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string TopAffixTemplateHandler { get; set; }

Sets the value of the PromptBox.

C#
public string Value { get; set; }

Methods

Gets the generated initialization script.

C#
protected override string GetInitializationScript()
Returns:

string

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()

Serializes the defined templates.

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

Dictionary<string, object>

Overrides: TagHelperBase.SerializeTemplates()

Writes content to the output.

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

Overrides: TagHelperBase.WriteHtml(TagHelperOutput)