Mark Sandman Mark Sandman - 1 year ago 106 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?


Answer Source

try this

Me.mydiv.Attributes("class") = ""
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download