public override string InnerHtml()
{
var items = new List<IFormControl>();
var dictionary = new Dictionary<string, bool>();
foreach (var control in _controls.Select(c => c.Invoke(this)))
{
items.Add(control);
if (control is Label)
dictionary[control.LabelId] = true;
else
if (!dictionary.ContainsKey(control.LabelId)) dictionary[control.LabelId] = false;
}
foreach (var noLabel in dictionary.Where(x => !x.Value))
{
var label = new Label(this, noLabel.Key, noLabel.Key);
label.Attrs["class"] += "sr-only";
items.Add(label);
}
return string.Join("", items.Select(x => x.ToHtmlString()));
}