Mark Sandman Mark Sandman - 2 months ago 10 Question

Remove a CSS class from HTML element in the code behind file

I have the following on my interface / webform:

<div id="mydiv" class="forceHeight" runat="server" />

now I have a dondition in my code behind where if a certain situation is true I need to remove the forceHeight class from this control. I know in C# you can use:

mydiv.CssClass.Replace("forceHeight", "");

I'm not so sure how you do this using VB? Intellisense doesn't offer me this option?

Any ideas anyone?



try this

Me.mydiv.Attributes("class") = ""