I have the following on my interface / webform:
Now I have a condition in my
If a control has several classes you can remove one of those classes by editing the class string. Both of these methods require assigning an ID to the HTML element so that you can target it in the code behind.
VB.NET
mydiv.CssClass = mydiv.CssClass.Replace("forceHeight", "").Trim()
C#
mydiv.CssClass = mydiv.CssClass.Replace("forceHeight", "").Trim();
OR using html generic control
VB.NET
mydiv.Attributes("class") = mydiv.Attributes("class").Replace("forceHeight", "").Trim()
C#
mydiv.Attributes["class"] = mydiv.Attributes["class"].Replace("forceHeight", "").Trim();
Optional Trim
to remove trailing white space.
VB.NET
mydiv.Attributes("class") = ""
C#
mydiv.Attributes["class"] = "";