Class AttributeCollectionExtension
Inheritance
Inherited Members
Namespace: WebApplication.Framework.Extensions
Assembly: WebApplication.dll
Syntax
public static class AttributeCollectionExtension
Methods
| Improve this Doc View SourceAddClass(WebControl, String[])
Appends the CSS
classes passed as parameters to the already existing ones in the control System.Web.UI.WebControls.WebControl.Attributes collection.
If there is no attribute named "class"
in the collection, one will be added.
Declaration
public static void AddClass(this WebControl webControl, params string[] classNameParams)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.String[] | classNameParams | The class name to add |
AddCssClass(WebControl, String[])
Appends the CSS
classes passed as parameters to the already existing ones in the control System.Web.UI.WebControls.WebControl.CssClass property.
Declaration
public static void AddCssClass(this WebControl webControl, params string[] classNameParams)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.String[] | classNameParams | The class name to add |
GetClassesExcept(WebControl, IEnumerable<String>)
Returns the CSS
classes of the attribute "class"
in the control System.Web.UI.WebControls.WebControl.Attributes collection, excluding the ones passed as parameters.
Declaration
public static IEnumerable<string> GetClassesExcept(this WebControl webControl, IEnumerable<string> classNames)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.Collections.Generic.IEnumerable<System.String> | classNames | The class name that will be excluded from the result |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
GetCssClassesExcept(WebControl, IEnumerable<String>)
Returns the CSS
classes in the property System.Web.UI.WebControls.WebControl.CssClass, excluding the ones passed as parameters.
Declaration
public static IEnumerable<string> GetCssClassesExcept(this WebControl webControl, IEnumerable<string> classNames)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.Collections.Generic.IEnumerable<System.String> | classNames | The class name that will be excluded from the result |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
RemoveClass(WebControl, String[])
Remove the CSS
classes of the attribute "class"
defined in the control System.Web.UI.WebControls.WebControl.Attributes collection, that match the names passed as parameters.
If the attribute "class"
in the collection has no CSS
classes it will be removed from the control.
Declaration
public static void RemoveClass(this WebControl webControl, params string[] classNameParams)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.String[] | classNameParams | The class name to remove |
RemoveCssClass(WebControl, String[])
Removes from the control System.Web.UI.WebControls.WebControl.CssClass property, the CSS
classes that match the name from the passed parameters.
Declaration
public static void RemoveCssClass(this WebControl webControl, params string[] classNameParams)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.WebControls.WebControl | webControl | The type the method operates on |
System.String[] | classNameParams | The class name to remove |