当前位置: 首页>>代码示例>>C#>>正文


C# HtmlHelper.TextArea方法代码示例

本文整理汇总了C#中HtmlHelper.TextArea方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlHelper.TextArea方法的具体用法?C# HtmlHelper.TextArea怎么用?C# HtmlHelper.TextArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlHelper的用法示例。


在下文中一共展示了HtmlHelper.TextArea方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderElementByType

        private static String RenderElementByType(HtmlHelper html, FormElement model, String elementName, String elementValue)
        {
            var builder = new StringBuilder();
            switch (model.Type)
            {
                case FormElementType.TextField:
                    {
                        builder.Append(html.Encode(model.Title));
                        break;
                    }
                case FormElementType.TextBox:
                    {
                        builder.Append(html.Label(elementName, model.Title));
                        builder.Append("<br/>");
                        builder.Append(html.TextBox(elementName, elementValue));
                        break;
                    }
                case FormElementType.TextArea:
                    {
                        builder.Append(html.Label(elementName, model.Title));
                        builder.Append("<br/>");
                        builder.Append(html.TextArea(elementName, elementValue));
                        break;
                    }
                case FormElementType.CheckBox:
                    {
                        builder.Append(html.SimpleCheckBox(elementName, FormCollectionExtensions.BooleanValue(elementValue)));
                        builder.Append(html.Label(elementName, model.Title));
                        break;
                    }
                case FormElementType.DropDownList:
                    {
                        builder.Append(html.Label(elementName, model.Title));
                        builder.Append("<br/>");
                        builder.Append(html.DropDownList(elementName, ParseElementValuesForDropDown(model.ElementValues, elementValue)));
                        break;
                    }
                case FormElementType.RadioButtons:
                    {
                        builder.Append(html.Label(elementName, model.Title));
                        builder.Append("<br/>");
                        builder.Append(html.RadioList(elementName, ParseElementValuesForRadioButtons(model.ElementValues, elementName), elementValue));
                        break;
                    }
                case FormElementType.Captcha:
                    {
                        builder.Append(html.CaptchaImage(CaptchaDefaultHeight, CaptchaDefaultWidth));
                        builder.Append(html.Label(elementName, String.Empty));
                        builder.Append("<br/>");
                        builder.Append(html.CaptchaTextBox(elementName));
                        break;
                    }

                default:
                    break;
            }

            return builder.ToString();
        }
开发者ID:coreframework,项目名称:Core-Framework,代码行数:59,代码来源:FormElementsExtensions.cs

示例2: RenderTextArea

        public static string RenderTextArea(HtmlHelper html, BootstrapTextAreaModel model)
        {
            if (model == null || string.IsNullOrEmpty(model.htmlFieldName)) return null;

            string validationMessage = "";
            if (model.displayValidationMessage)
            {
                string validation = html.ValidationMessage(model.htmlFieldName).ToHtmlString();
                validationMessage = new BootstrapHelpText(validation, model.validationMessageStyle).ToHtmlString();
            }
            if(!string.IsNullOrEmpty(model.id)) model.htmlAttributes.AddOrReplace("id", model.id);
            if (model.tooltipConfiguration != null) model.htmlAttributes.AddRange(model.tooltipConfiguration.ToDictionary());
            return html.TextArea(model.htmlFieldName, model.value, model.rows, model.columns, model.htmlAttributes.FormatHtmlAttributes()).ToHtmlString() + validationMessage;
        }
开发者ID:joypipi,项目名称:TwitterBootstrapMvc,代码行数:14,代码来源:Renderer.TextArea.cs

示例3: WriteInput

 public override MvcHtmlString WriteInput(HtmlHelper helper, object htmlAttributes)
 {
     IDictionary<string, object> efHtmlAttributes = new RouteValueDictionary(htmlAttributes);
     AddCommonHtmlAttributes(efHtmlAttributes);
     return helper.TextArea(this.InputName, this.Value, efHtmlAttributes);
 }
开发者ID:rupeshtelang,项目名称:ExpressForms,代码行数:6,代码来源:ExpressFormsTextArea.cs

示例4: MultilineTextTemplate

 internal static string MultilineTextTemplate(HtmlHelper html)
 {
     return html.TextArea(String.Empty,
                          html.ViewContext.ViewData.TemplateInfo.FormattedModelValue.ToString(),
                          0 /* rows */, 0 /* columns */,
                          CreateHtmlAttributes(html, "text-box multi-line")).ToHtmlString();
 }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:7,代码来源:DefaultEditorTemplates.cs

示例5: Render

 /// <summary>
 /// Renders the specified HTML.
 /// </summary>
 /// <param name="html">The HTML helper.</param>
 /// <param name="name">The element name.</param>
 /// <param name="value">The element value.</param>
 /// <param name="values">The element values.</param>
 /// <returns>Returns element html code.</returns>
 public override string Render(HtmlHelper html, String name, String value, String values)
 {
     return html.TextArea(name, value).ToString();
 }
开发者ID:coreframework,项目名称:Core-Framework,代码行数:12,代码来源:TextAreaAttribute.cs


注:本文中的HtmlHelper.TextArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。