Mark Sandman Mark Sandman - 3 months ago 15
Vb.net 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?

MS

Answer

try this

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