/// <summary> /// Creates the framework control. /// </summary> /// <param name="context">Contains information associated with the current HTML tag.</param> /// <param name="output">A stateful HTML element used to generate an HTML tag.</param> /// <returns>The control instance.</returns> protected override FWInputControl RenderInputControl(TagHelperContext context, TagHelperOutput output) { FWTextboxControl control; if (ValidateFor == null) { control = new FWTextboxControl(RequestContext, For.Model, For.Metadata); control.Attributes.Add("data-control", "textbox"); } else { control = new FWTextboxControl(RequestContext, null, ValidateFor.Metadata); control.Validation(); } control.Password(); if (!string.IsNullOrWhiteSpace(Icon)) { control.Icon(Icon); } if (!string.IsNullOrWhiteSpace(Placeholder)) { control.PlaceHolder(Placeholder); } return(control); }
/// <summary> /// Creates the framework control. /// </summary> /// <param name="context">Contains information associated with the current HTML tag.</param> /// <param name="output">A stateful HTML element used to generate an HTML tag.</param> /// <returns>The control instance.</returns> protected override FWInputControl RenderInputControl(TagHelperContext context, TagHelperOutput output) { FWTextboxControl control = new FWTextboxControl(RequestContext, For.Model, For.Metadata); control.Attributes.Add("data-control", "textbox"); if (!string.IsNullOrWhiteSpace(Icon)) { control.Icon(Icon); } if (!string.IsNullOrWhiteSpace(Placeholder)) { control.PlaceHolder(Placeholder); } if (Autocomplete != null) { control.Autocomplete(Autocomplete, Results, ForceSelection); } return(control); }