本文整理汇总了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();
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}