public void Execute(IMemberElement element) { var attribute = new MemberBehaviorHelper<StringLengthAttribute>().GetAttribute(element); if(attribute != null && element is ISupportsMaxLength) { element.SetAttr(HtmlAttribute.MaxLength, attribute.MaximumLength); } }
public void Execute(IMemberElement element) { var helper = new MemberBehaviorHelper<RequiredAttribute>(); var attribute = helper.GetAttribute(element); if (attribute != null) { element.SetAttr("class", "req"); } }
public void Execute(IMemberElement element) { var helper = new MemberBehaviorHelper <RequiredAttribute>(); var attribute = helper.GetAttribute(element); if (attribute != null) { element.SetAttr(HtmlAttribute.Class, "required"); } }
public void Execute(IMemberElement element) { var helper = new MemberBehaviorHelper<RangeAttribute>(); var attribute = helper.GetAttribute(element); if (attribute == null) { return; } if (element is ISupportsMaxLength) { element.SetAttr(HtmlAttribute.MaxLength, attribute.Maximum); } }
public void Execute(IMemberElement element) { var helper = new MemberBehaviorHelper <StringLengthAttribute>(); var attribute = helper.GetAttribute(element); if (attribute == null) { return; } if (element is ISupportsMaxLength) { element.SetAttr(HtmlAttribute.MaxLength, attribute.MaximumLength); } }