public static void PasswordTemplate(HtmlHelper html, IXcstPackage package, ISequenceWriter <object> seqOutput) { XcstWriter output = DocumentWriter.CastElement(package, seqOutput); string?className = GetEditorCssClass(new EditorInfo("Password", "input", InputType.Password), "text-box single-line password"); var htmlAttributes = CreateHtmlAttributes(html, className, addMetadataAttributes: true); InputInstructions.Input(html, output, String.Empty, value: null, type: "password", htmlAttributes: htmlAttributes); }
static void HtmlInputTemplateHelper(HtmlHelper html, IXcstPackage package, ISequenceWriter <object> seqOutput, string templateName, string?inputType = null) { XcstWriter output = DocumentWriter.CastElement(package, seqOutput); object value = html.ViewData.TemplateInfo.FormattedModelValue; string?className = GetEditorCssClass(new EditorInfo(templateName, "input", InputType.Text), "text-box single-line"); var htmlAttributes = CreateHtmlAttributes(html, className, inputType: inputType, addMetadataAttributes: true); InputInstructions.Input(html, output, name: String.Empty, value: value, htmlAttributes: htmlAttributes); }
public static void HiddenInputTemplate(HtmlHelper html, IXcstPackage package, ISequenceWriter <object> seqOutput) { ViewDataDictionary viewData = html.ViewData; if (!viewData.ModelMetadata.HideSurroundingHtml) { DefaultDisplayTemplates.StringTemplate(html, package, seqOutput); } XcstWriter output = DocumentWriter.CastElement(package, seqOutput); object?model = viewData.Model; string?className = GetEditorCssClass(new EditorInfo("HiddenInput", "input", InputType.Hidden), null); var htmlAttributes = CreateHtmlAttributes(html, className); InputInstructions.Input(html, output, String.Empty, model, type: "hidden", htmlAttributes: htmlAttributes); }