public static HtmlTag LabelCC <T>(this HtmlHelper <T> helper, Expression <Func <T, object> > expression) where T : class { ITagGenerator <T> generator = GetGenerator <T>(helper, expression); HtmlTag tag = generator.LabelFor(expression); return(tag); }
public TLayout Display(Expression <Func <TModel, object> > expression) { var layout = new TLayout(); var accessor = expression.ToAccessor(); var request = _generator.GetRequest(accessor); layout.LabelTag = _generator.LabelFor(request); layout.BodyTag = _generator.DisplayFor(request); return(layout); }
public FormLineExpression(ITagGenerator <T> tags, ILabelAndFieldLayout layout, ElementRequest request) { _tags = tags; _layout = layout; _request = request; _layout.LabelTag = tags.LabelFor(request); AlterLayout(x => GroupByCssClasses.Each(c => { x.LabelTag.AddClass(c); x.BodyTag.AddClass(c); })); }
public HtmlTag ToHtmlTag() { _htmlRoot = new HtmlTag("div"); _htmlRoot.AddClass(_inLine ? "editor_label_inline" : "editor_label"); if (_labelRootClasses != null && _labelRootClasses.Any()) { _htmlRoot.AddClasses(_labelRootClasses); } if (_hide) { _htmlRoot.Hide(); } HtmlTag label = _generator.LabelFor(_expression); if (_labelClasses != null && _labelClasses.Any()) { label.AddClasses(_labelClasses); } if (_elementId.IsNotEmpty()) { label.Id(_elementId); } if (_customDisplay.IsNotEmpty()) { label.Text(_customDisplay); } if (_colonAfterLabel && !_LeadingColon) { label.Text(label.Text() + ":"); } if (_colonAfterLabel && _LeadingColon) { label.Text(":" + label.Text()); } // if (ReflectionHelper.GetProperty(_expression).HasAttribute<ValidateNonEmptyAttribute>()) // { // label.Text(label.Text()+"*"); // } _htmlRoot.Append(label); return(_htmlRoot); }
public HtmlTag ToHtmlTag() { _htmlRoot = new HtmlTag("div").AddClass("KYT_editor_label"); if (_labelRootClass.IsNotEmpty()) { _htmlRoot.AddClass(_labelRootClass); } if (_hide) { _htmlRoot.Hide(); } HtmlTag label = _generator.LabelFor(_expression); if (_labelClass.IsNotEmpty()) { label.AddClass(_labelClass); } if (_elementId.IsNotEmpty()) { label.Id(_elementId); } if (_customDisplay.IsNotEmpty()) { label.Text(_customDisplay); } if (!_noColon && !_LeadingColon) { label.Text(label.Text() + ":"); } if (!_noColon && _LeadingColon) { label.Text(":" + label.Text()); } if (ReflectionHelper.GetProperty(_expression).HasAttribute <ValidateNonEmptyAttribute>()) { label.Text(label.Text() + "*"); } _htmlRoot.Child(label); return(_htmlRoot); }
public HtmlTag ToHtmlTag() { _htmlRoot = new HtmlTag("div").AddClass("KYT_view_label"); if (_labelRootClass.IsNotEmpty()) { _htmlRoot.AddClass(_labelRootClass); } if (_hide) { _htmlRoot.Hide(); } HtmlTag label = _generator.LabelFor(_expression); if (_labelClass.IsNotEmpty()) { label.AddClass(_labelClass); } if (_elementId.IsNotEmpty()) { label.Id(_elementId); } if (_customDisplay.IsNotEmpty()) { label.Text(_customDisplay); } if (!_noColon && !_LeadingColon) { label.Text(label.Text() + ":"); } if (!_noColon && _LeadingColon) { label.Text(":" + label.Text()); } _htmlRoot.Child(label); return(_htmlRoot); }