I have the following on my interface / webform:
Now I have a condition in my
I find it better to use REGEX replace since replacing class could exist as partial name in other classes which would break them. So I'm using the following extension method:
public static void RemoveClass(this WebControl control, string classToRemove)
{
if (control == null)
return;
control.CssClass = Regex.Replace(control.CssClass, @"(^|\s)" + classToRemove + @"($|\s)", " ");
}