protected void RemoveAttribute(String attributeName) { if (LocalizedAttributes.ContainsKey(attributeName)) { LocalizedAttributes.Remove(attributeName); } if (OtherAttributes.ContainsKey(attributeName)) { OtherAttributes.Remove(attributeName); } }
/// <summary> /// Adds (does not overwrite) classes to the tag /// </summary> /// <param name="classNames">the classname(s) to add</param> /// <returns>returns itself</returns> public LocalizedHtmlTag Class(params String[] classNames) { const String classAttr = "class"; foreach (var className in classNames) { if (LocalizedAttributes.ContainsKey(classAttr)) { LocalizedAttributes.Remove(classAttr); } if (OtherAttributes.ContainsKey(classAttr)) { OtherAttributes[classAttr] = OtherAttributes[classAttr] + " " + className; } else { OtherAttributes.Add(classAttr, className); } } return(this); }