Exemple #1
0
        public static MvcHtmlString VnrTextArea(this HtmlHelper helper, TextAreaBuilderInfo builderInfo)
        {
            string str = "<textarea class='k-textbox' ";

            if (!string.IsNullOrWhiteSpace(builderInfo.Name))
            {
                str += "name='" + builderInfo.Name + "' id='" + builderInfo.Name + "' ";
            }
            builderInfo.CssStyle = "width:" + builderInfo.Width + "px;height:" + builderInfo.Height + "px;" + builderInfo.CssStyle;
            if (!string.IsNullOrWhiteSpace(builderInfo.CssStyle))
            {
                str += "style='" + builderInfo.CssStyle + "'";
            }
            str += "></textarea>";
            return(MvcHtmlString.Create(str.ToString()));
        }
Exemple #2
0
        public static MvcHtmlString VnrTextAreaFor <TModel, TProperty>(this HtmlHelper <TModel> helper,
                                                                       Expression <Func <TModel, TProperty> > expression, TextAreaBuilderInfo builderInfo)
        {
            var strId = helper.ViewData.TemplateInfo.GetFullHtmlFieldId(ExpressionHelper.GetExpressionText(expression));

            if (!string.IsNullOrWhiteSpace(builderInfo.Name))
            {
                strId = builderInfo.Name;
            }
            string str = "<textarea class='k-textbox' name='" + strId + "' id='" + strId + "' ";

            builderInfo.CssStyle = "width:" + builderInfo.Width + "px;height:" + builderInfo.Height + "px;" + builderInfo.CssStyle;
            if (!string.IsNullOrWhiteSpace(builderInfo.CssStyle))
            {
                str += "style='" + builderInfo.CssStyle + "'";
            }
            str += "></textarea>";
            return(MvcHtmlString.Create(str.ToString()));
        }