Beispiel #1
0
        private static IHtmlContent GenerateEditor <TModel, TValue>(IHtmlHelper <TModel> html, Expression <Func <TModel, TValue> > expression, string toolTip, string errorMessage, IHtmlContent label)
        {
            IHtmlContent contents  = HtmlHelperEditorExtensions.EditorFor(html, expression, new { htmlAttributes = new { @class = "form-control", @title = toolTip } });
            IHtmlContent validator = HtmlHelperValidationExtensions.ValidationMessageFor(html, expression, errorMessage, new { @class = "text-danger" });

            string result = String.Concat("<div class=\"form-group\">",
                                          GetString(label),
                                          "<div class=\"col-md-8\">",
                                          GetString(contents),
                                          GetString(validator),
                                          "</div>",
                                          "</div>");

            return(new HtmlString(result));
        }
Beispiel #2
0
 public static IHtmlContent EditorFor <TModel, TValue>(this HtmlHelper <TModel> html, Expression <Func <TModel, TValue> > expression)
 {
     // Methods.SetDefaultDateTime(html, expression);
     return(HtmlHelperEditorExtensions.EditorFor(html, expression));
 }