Exemple #1
0
        public static MvcHtmlString VnrPassword(this HtmlHelper helper, PasswordBuilderInfo builderInfo)
        {
            var str = "<input class='k-textbox " + builderInfo.Class + "' type='password' ";

            if (!string.IsNullOrWhiteSpace(builderInfo.Id))
            {
                str += "id='" + builderInfo.Id + "'";
            }
            if (!string.IsNullOrWhiteSpace(builderInfo.Name))
            {
                str += "name='" + builderInfo.Name + "'";
            }
            if (!string.IsNullOrWhiteSpace(builderInfo.StyleCss))
            {
                str += "style='" + builderInfo.StyleCss + "'";
            }

            if (!string.IsNullOrWhiteSpace(builderInfo.Value))
            {
                str += "value='" + builderInfo.Value + "'";
            }
            str += "/>";
            return(MvcHtmlString.Create(str.ToString()));
        }
Exemple #2
0
        public static MvcHtmlString VnrPasswordFor <TModel, TProperty>(this HtmlHelper <TModel> helper,
                                                                       Expression <Func <TModel, TProperty> > expression, PasswordBuilderInfo builderInfo)
        {
            var strId = helper.ViewData.TemplateInfo.GetFullHtmlFieldId(ExpressionHelper.GetExpressionText(expression));

            if (!string.IsNullOrWhiteSpace(builderInfo.Id))
            {
                strId = builderInfo.Id;
            }
            var str = "<input class='k-textbox " + builderInfo.Class + "' id='" + strId + "' name='" + strId + "' type='password' ";

            if (!string.IsNullOrWhiteSpace(builderInfo.StyleCss))
            {
                str += "style='" + builderInfo.StyleCss + "'";
            }

            if (!string.IsNullOrWhiteSpace(builderInfo.Value))
            {
                str += "value='" + builderInfo.Value + "'";
            }
            str += "/>";
            return(MvcHtmlString.Create(str.ToString()));
        }